
17th January 2008, 05:06
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
|
|
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?
|

17th January 2008, 09:55
|
|
Junior Member
|
|
Join Date: Jan 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

17th January 2008, 21:44
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
|
|
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?
|

17th January 2008, 22:10
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
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.
|
|
The Following User Says Thank You to unclecameron For This Useful Post:
|
|

18th January 2008, 05:41
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
|
|
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!
|

18th January 2008, 07:09
|
|
Senior Member
|
|
Join Date: Apr 2006
Posts: 115
Thanks: 2
Thanked 8 Times in 7 Posts
|
|
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.
|

19th January 2008, 03:41
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
|
|
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?
|

19th January 2008, 04:54
|
|
Junior Member
|
|
Join Date: Jan 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

19th January 2008, 19:50
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 178
Thanks: 6
Thanked 1 Time in 1 Post
|
|
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.
|

20th January 2008, 19:47
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 00:17.
|
Recent comments
2 days 15 hours ago
3 days 15 sec ago
3 days 2 hours ago
3 days 4 hours ago
3 days 5 hours ago
3 days 7 hours ago
3 days 8 hours ago
3 days 9 hours ago
4 days 1 hour ago
4 days 2 hours ago