LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-08-2010, 03:24 PM   #1
walterbyrd
Member
 
Registered: Apr 2004
Posts: 565

Rep: Reputation: 30
Apache2 - having trouble setting up multiple domains under debian etch


I know I am using apache2, but I'm not sure if it's 2.2 or whatever. How can I can find out?

I am trying to follow the instructions from this site:

http://www.debian-administration.org/articles/412

But it does not work, apache will not even load.

My /etc/apache2/conf.d/virtual.conf looks like this:

Quote:
# We're running multiple virtual hosts.
#
NameVirtualHost *
I have a file called /etc/apache2/sites-available/default

I did not create that file, but as long as I only have that file enabled, apache works. Although I get is that default "it works" message.

I am not sure if I should use "site.com" for the site name, and "www.sitename.com" for the site alias, or the other way around.

My domain files look like this:

Quote:
#
# example.com (/etc/apache2/sites-available/example.com)
#
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName example.com
ServerAlias www.example.com

# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /var/www/example.com/


# Logfiles
ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined
</VirtualHost>
My /var/www/example.com/index.html files do exist. And example.com is pingable.

Any glaring errors?
 
Old 01-08-2010, 03:59 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
I do hosting for a few dozen domains and I use this...

NameVirtualHost *
Code:
<VirtualHost *>

        ServerAdmin webmaster@template.tld
        ServerName template.tld
        ServerAlias *.template.tld

        DocumentRoot /var/www/template.tld/htdocs

        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>

        <Directory /var/www/template.tld/htdocs>
                Options Indexes FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/template.tld/cgi-bin/
        <Directory "/var/www/template.tld/cgi-bin">
                AllowOverride All
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/www/template.tld/log/error.log

        LogLevel warn

        CustomLog /var/www/template.tld/log/access.log combined
        ServerSignature On

</VirtualHost>
Of course the script that sets this up creates all the relevant directories, sets permissions, adds users, etc...

Don't forget to make a symlink between /sites-available and /sites-enabled, make sure the directories exist, make sure the dns is setup to point to this machine, and if that doesn't work include a copy of your system and site access/error logs (last 20 lines) in your reply.
 
Old 01-08-2010, 06:15 PM   #3
walterbyrd
Member
 
Registered: Apr 2004
Posts: 565

Original Poster
Rep: Reputation: 30
I still get a "Page Load Error" should this tell me anything?

/var/log/apache2/access.log
Quote:
::1 - - [08/Jan/2010:14:26:29 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:14:26:29 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:14:26:30 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:14:26:30 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:14:26:30 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:17:04:39 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:17:04:39 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:17:04:39 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:17:04:39 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
::1 - - [08/Jan/2010:17:04:39 -0700] "GET / HTTP/1.0" 302 315 "-" "Apache/2.2.3 (Debian) (internal dummy connection)"
 
Old 01-08-2010, 07:03 PM   #4
walterbyrd
Member
 
Registered: Apr 2004
Posts: 565

Original Poster
Rep: Reputation: 30
Using your script as a template, what happens now is: apache will reload, but I get "page load errors." Then if I try to reload apache again, apache will not reload. If I go back and a2dissite example.com, then apache will reload.

Quote:
# a2ensite example.com
Site example.com installed; run /etc/init.d/apache2 reload to enable.
# /etc/apache2/sites-available# /etc/init.d/apache2 reload
Reloading web server config...1432
.
# /etc/init.d/apache2 reload
Reloading web server config...1432
httpd not running, trying to start
failed!
# /etc/apache2/sites-available# a2dissite example.com
Site example.com disabled; run /etc/init.d/apache2 reload to fully disable.
# /etc/apache2/sites-available# /etc/init.d/apache2 reload
Reloading web server config...1432
httpd not running, trying to start
e# /etc/init.d/apache2 reload
Reloading web server config...31756

Last edited by walterbyrd; 01-08-2010 at 07:04 PM. Reason: used actual domain name
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache2 on Debian Etch not working finferflu Linux - Server 28 02-24-2011 05:03 AM
Setting up Python 2.5 on Apache2 in Debian Etch michux Linux - Server 3 09-10-2008 10:21 AM
Apache2 issue in Debian etch. Hammad101 Linux - Server 1 09-10-2008 08:15 AM
Setting up a generic subdomain for all domains using Apache2 kopite1 Linux - Server 3 04-28-2008 12:54 PM
LXer: Virtual Users And Domains With Postfix, Courier And MySQL (Debian Etch) LXer Syndicated Linux News 0 06-07-2007 07:47 PM


All times are GMT -5. The time now is 05:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration