Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just set up Debian Etch. When I browse to 127.0.0.1, I get the "It Works!" page, so Apache seems to be set up correctly. However, in /etc/apache2, my httpd.conf file is totally blank. I remember that file having content when running Apache in Windows, is it just diffrent in Linux, or is there something wrong there?
Also, I read a page that mentioned being able to access files from any users home folder, so long as they had them stored in a folder called public_html. So I set up a public_html in a users home folder (/home/char/public_html), and put a little test index.html in there, but when I try browsing to 127.0.0.1/~char, I get nothing. Well, I get an error saying the page doesn't exist.
Alright, and one last question, where does apache store web pages by default? In other words, where would I have to put web pages for them to be viewable? Somewhere in /var I assume? And how would I go about changing this?
Alright, so I checked out /usr/local, and I tried to find httpd.conf:
Athena:/# cd /usr/local
Athena:/usr/local# ls
bin etc games include lib man sbin share src
Athena:/usr/local# find / -iname httpd.conf
/etc/apache2/httpd.conf
Athena:/usr/local#
so it would seem like the only copy around is the blank one in /etc/apache2. And thanks for the link, but when I tried adding "Userdir public_html" to httpd.conf and restarting apache, I get the error:
Invalid command 'UserDir', perhaps misspelled or defined by a module not included in the server configuration
So I tried to include the module "mod_userdir.so" from /usr/lib/apache2/modules/, and now when trying to start Apache, I get the error:
Syntax error on line 1 of /usr/lib/apache2/modules/mod_userdir.so:
Invalid command '\x7fELF\x01\x01\x01', perhaps misspelled or defined by a module not included in the server configuration
httpd not running, trying to start
Its strange that its empty, thats where your problem probably is is maybe it wasn't installed correctly. Either try and remove the package (if you use apt-get) and reinstall it. Or maybe compile and install from source.
During the install process for Debian it allows you to select from a number of diffrent groups of packages, one of which is "web server" (or something to that effect). I selected it there, so Apache was installed along with the rest of the system. So in that case, how would I go about uninstalling/reinstalling it?
Turns out debian uses apache2.conf in place of httpd.conf (I'd like to know why, seems odd to just go against convention like that.). So I took the lines for the userdir stuff from the previously empty httpd.conf file, put them in the apache2.conf file... and same error. So I poked around a bit, and found two files of interest in /etc/apache2/mods-available/: userdir.conf, and userdir.load. So I changed the "Include /usr/lib/apache2/modules/mod_userdir.so" line to "Include /etc/apache2/mods-available/userdir.conf" and... pretty much the same error. So I tried "Include /etc/apache2/mods-available/userdir.load", and bam! Everything works.
So, looks like the only question left if where does Apache2 in Debian point to for it's default web hosting directory (can't seem to find any mention of any place in apache2.conf), and how does one go about changing it?
And thanks kcorupe for all your help so far.
EDIT: found the default directory, it's /var/www/apache2-default
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.