Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th January 2008, 05:06
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Red face Apache domain to directory?

I have an basic apache server running phpmyadmin and a joomla site I am trying to setup. My systems domain is atlbricks.com. When I type in atlbricks.com I want apache do show atlbricks.com/index.php which would be /var/www/atlbricksmain/ How can I do this?
Reply With Quote
Sponsored Links
  #2  
Old 17th January 2008, 09:55
devnull3d devnull3d is offline
Junior Member
 
Join Date: Jan 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well if you don't plan to host other domains on you box then you can just change the physical host of apache to point at /var/www/atlbricksmain/ in your httpd.conf or apache2.conf, search for <Direcotry and you should see something like this <Directory "/var/www/apache-default"> just change the location to /var/www/atlbricksmain and you're good to go.
Also make sure you have loaded the php module LoadModule php5_module modules/libphp5.so or something like that. And make sure you have index.php in your DirectoryIndex directive. All of this is in your apache configuration file.
If you want to use virtual hosts so you can host more than one domain on the same IP, well that's another story.
Reply With Quote
  #3  
Old 17th January 2008, 21:44
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by devnull3d
Well if you don't plan to host other domains on you box then you can just change the physical host of apache to point at /var/www/atlbricksmain/ in your httpd.conf or apache2.conf, search for <Direcotry and you should see something like this <Directory "/var/www/apache-default"> just change the location to /var/www/atlbricksmain and you're good to go.
Also make sure you have loaded the php module LoadModule php5_module modules/libphp5.so or something like that. And make sure you have index.php in your DirectoryIndex directive. All of this is in your apache configuration file.
If you want to use virtual hosts so you can host more than one domain on the same IP, well that's another story.
I added

/var/www/atlbricksmain

to my httpd.conf file then restarted the server and got an error message. The server refused to start with that line in the httpd.conf file. Then I searched the apache2.conf file did a search for apache-default and come up with nothing found. Could you post your apache2.conf file?
Reply With Quote
  #4  
Old 17th January 2008, 22:10
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default

if you're using Debian you want to probably alter /etc/apache2/sites-available/default and put what you need in there, otherwise you can append it to the end of /etc/apache2/apache2.conf, but if you have the first file you want to do it there, otherwise your changes won't work.
Reply With Quote
The Following User Says Thank You to unclecameron For This Useful Post:
badgerbox76 (18th January 2008)
  #5  
Old 18th January 2008, 05:41
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Talking

Quote:
Originally Posted by unclecameron
if you're using Debian you want to probably alter /etc/apache2/sites-available/default and put what you need in there, otherwise you can append it to the end of /etc/apache2/apache2.conf, but if you have the first file you want to do it there, otherwise your changes won't work.
Once again I just want to thank everyone for there help. I am almost there but not quite. With the file setup like this I get a forbidden error but if I setup the DocumentRoot to /var/www/atlbricksmain it works which is good but I also have another directory which is phpmyadmin that I need to be able to run, how can I get that directory to run when I type in http://www.atlbricks.com/phpmyadmin

Code:
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/atlbricksmain>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
Thanks crew!
Reply With Quote
  #6  
Old 18th January 2008, 07:09
unclecameron unclecameron is offline
Senior Member
 
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
Default

You need something like this inside your virtualhost directive:

Alias /phpmyadmin/ /pathtowherephpmyadmin/isinstalled/
<Directory "/pathtowherephpmyadmin/isinstalled">
Options Indexes Includes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

then it should work.
Reply With Quote
  #7  
Old 19th January 2008, 03:41
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by unclecameron
You need something like this inside your virtualhost directive:

Alias /phpmyadmin/ /pathtowherephpmyadmin/isinstalled/
<Directory "/pathtowherephpmyadmin/isinstalled">
Options Indexes Includes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

then it should work.
Thanks I am now able to enter that directory with the web browser and view the files so php is not running phpmyadmin. What config file do I need to change now?
Reply With Quote
  #8  
Old 19th January 2008, 04:54
devnull3d devnull3d is offline
Junior Member
 
Join Date: Jan 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You probably need LoadModule php5_module libexec/libphp5.so and AddType application/x-httpd-php .php in your apache2.conf if you already have php installed.
Reply With Quote
  #9  
Old 19th January 2008, 19:50
badgerbox76 badgerbox76 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
Default

Sorry I am still confused, sometimes I am getting the 404 Not Found error other times I am getting an apache directory will all the phpmyadmin files in it. PHP is running but its only running Joomla (/var/www/atlbricksmain/) and its not running phpmyadmin (/var/www/phpmyadmin)

http://www.atlbricks.com/phpmyadmin/
http://www.atlbricks.com/


Code:
NameVirtualHost *
<VirtualHost *>


Alias /phpmyadmin/ /usr/share/phpmyadmin
<Directory "/usr/share/phpmyadmin">
Options Indexes Includes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

//Just added! I need this directory /var/www/tce to display the files in the directory when I type http://www.atlbricks.com/tce what am I doing wrong?

Alias /tce/   /home/systemadmin/tceserver/tcetest
<Directory /home/systemadmin/tceserver/tcetest>
Options Indexes Includes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>


        DocumentRoot /var/www/atlbricksmain
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/atlbricksmain>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>


</VirtualHost>
If I change the root directory to /var/www I get the forbidden error when I enter the sites address.

Sorry again but I am thinking its just a syntax error I am doing.

Last edited by badgerbox76; 14th December 2010 at 03:11.
Reply With Quote
  #10  
Old 20th January 2008, 19:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
 
Default

What's the output of
Code:
ls -la /var/www
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
directories in /home/admispconfig/ispconfig renamed? Spudchat General 10 12th April 2007 19:37
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 17:17
64-bit Debian 3.1 Install Issue naruto Installation/Configuration 14 5th September 2006 04:12
Problems with Apache and Updating Jubalint Installation/Configuration 2 21st May 2006 19:50
Mysterious Install Problem tgansert Installation/Configuration 5 9th May 2006 15:35


All times are GMT +2. The time now is 10:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.