LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-16-2007, 04:08 PM   #1
xor.gate
LQ Newbie
 
Registered: Aug 2007
Posts: 8

Rep: Reputation: 0
Newbie Apache questions


Ok,

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?
 
Old 08-16-2007, 05:33 PM   #2
kcorupe
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Arch
Posts: 107

Rep: Reputation: 15
I think depending on how you installed apache, it could be in /usr/local. Just do a find for the httpd.conf there should be one.


As for settingup per-user web directories, this should help.


http://httpd.apache.org/docs/2.2/howto/public_html.html
 
Old 08-16-2007, 06:07 PM   #3
xor.gate
LQ Newbie
 
Registered: Aug 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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

Anyone have any ideas?
 
Old 08-16-2007, 06:25 PM   #4
kcorupe
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Arch
Posts: 107

Rep: Reputation: 15
How did you install apache? just with apt-get?

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.
 
Old 08-16-2007, 06:39 PM   #5
xor.gate
LQ Newbie
 
Registered: Aug 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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?
 
Old 08-16-2007, 07:09 PM   #6
kcorupe
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Arch
Posts: 107

Rep: Reputation: 15
apt-get remove apache
 
Old 08-16-2007, 07:28 PM   #7
xor.gate
LQ Newbie
 
Registered: Aug 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Ah ha! Got it working.

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

Last edited by xor.gate; 08-16-2007 at 07:46 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache and apache-ssl questions merana Debian 4 03-10-2005 10:10 AM
Newbie questions craazy Linux - Networking 1 09-15-2004 05:38 PM
Newbie questions: about Apache & RPM tiger0516 Linux - Newbie 2 08-12-2004 06:35 PM
a few newbie questions prosh0t Linux - Software 3 07-29-2004 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration