JamesOxford
10-05-2011, 09:10 PM
So I am in the process of moving everything I have from a windows based xampp installation to an LAMP stack in Ubuntu Server. Having not used Linux before, there was already a bit of a learning curve, but now I am having all kinds of problems with the apache configuration. First, I am having problems setting a virtual host to listen to every request on port 80
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot /foo/bar/www
</VirtualHost>
This keeps throwing an error that apache cannot bind to a socket, or no sockets available. So I got this solved, but I am not entirely happy with the solution, and then I had another problem. I have a couple of domains where admin.mydomain.com should bring up a seperate document root than a request to mydomain.com. I used to just set the admin address's up on a separate virtual host with no problem. I can't get this to work now, and I am not sure what is different in my apache configuration. I am thinking about setting a regex expression to look for admin requests before the domain, and doing a re-direct. Is this my best option, or does anyone have another idea about what I might be doing wrong?
Finally, the last problem I am having is with the DirectoryIndex directive. In directories where there were both html and php indexes, my old server used to serve php files first. The DirectoryIndex section is set up identical to the windows installation, but now apache brings up the html files first. Does anyone know the solution to this? Apache doesn't seem to like those line breaks either, so I got rid of them in the Linux install.
<IfModule dir_module>
DirectoryIndex main.php main.html main.htm main.asp main.cgi main.shtml \
index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm \
</IfModule>
Help with any of these problems is greatly appreciated.
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot /foo/bar/www
</VirtualHost>
This keeps throwing an error that apache cannot bind to a socket, or no sockets available. So I got this solved, but I am not entirely happy with the solution, and then I had another problem. I have a couple of domains where admin.mydomain.com should bring up a seperate document root than a request to mydomain.com. I used to just set the admin address's up on a separate virtual host with no problem. I can't get this to work now, and I am not sure what is different in my apache configuration. I am thinking about setting a regex expression to look for admin requests before the domain, and doing a re-direct. Is this my best option, or does anyone have another idea about what I might be doing wrong?
Finally, the last problem I am having is with the DirectoryIndex directive. In directories where there were both html and php indexes, my old server used to serve php files first. The DirectoryIndex section is set up identical to the windows installation, but now apache brings up the html files first. Does anyone know the solution to this? Apache doesn't seem to like those line breaks either, so I got rid of them in the Linux install.
<IfModule dir_module>
DirectoryIndex main.php main.html main.htm main.asp main.cgi main.shtml \
index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm \
</IfModule>
Help with any of these problems is greatly appreciated.