Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th January 2012, 13:09
mitho7 mitho7 is offline
Member
 
Join Date: Apr 2007
Posts: 33
Thanks: 4
Thanked 1 Time in 1 Post
Default apache2 vitual host config

Hi Team,

i'm having some issue with vitual host set up. i have one site set up now, with SSL and working ok. I'm trying to set up another virtual host but not having luck. my set up is:

port.conf:
--------------
Listen 80
Listen 443
NameVirtualHost *:443
NameVirtualHost *:80
-----------------------

sites-available/www.site1.com
----------------
<VirtualHost *:80>
ServerAdmin admin@site1.com
ServerName www.site1.com
ServerAlias site1.com
# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot /var/www/site1/public_html

# CGI Directory
ScriptAlias /cgi-bin/ /var/www/site1/cgi-bin
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /var/www/site1/logs/error.log
CustomLog /var/www/site1/logs/access.log combined
</VirtualHost>
-------------------

sites-available/www.site1.com-ssl:
-----------------------------------
<VirtualHost *:443>
ServerAdmin admin@site1.com
ServerName www.site1.com
ServerAlias site1.com
# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot /var/www/site1/public_html
# CGI Directory
ScriptAlias /cgi-bin/ /var/www/site1/cgi-bin
<Location /cgi-bin>
Options +ExecCGI
</Location>
SSLEngine on
SSLCertificateFile /var/www/site1/ssl/www.site1.com.crt
SSLCertificateKeyFile /var/www/site1/ssl/www.site1.com.key
SSLCACertificateFile /var/www/site1/ssl/www_site1_com_apache.crt
# Logfiles
ErrorLog /var/www/site1/logs/error.log
CustomLog /var/www/site1/logs/access.log combined
</VirtualHost>
---------------------------------------------------------------------

Above configuration is working fine. After I do "a2ensite www.site2.com" and reload apache config i can not access www.site1.com or https//www.site1.com. I tried to restart the apache as well. no errors comes up for restart and reload apache.

config for: sites-available/www.site2.com
-------------------------------------------
<VirtualHost *:80>
ServerAdmin admin@site2.com
ServerName www.site2.com
ServerAlias site2.com

# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot /var/www/site2/public_html

# CGI Directory
ScriptAlias /cgi-bin/ /var/www/site2/cgi-bin
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog /var/www/site2/logs/error.log
CustomLog /var/www/site2/logs/logs/access.log combined
</VirtualHost>



Hoping some help.

Thanks,
__________________
--
Bip
www.makeonlineshop.com
Reply With Quote
Sponsored Links
  #2  
Old 31st January 2012, 13:24
mitho7 mitho7 is offline
Member
 
Join Date: Apr 2007
Posts: 33
Thanks: 4
Thanked 1 Time in 1 Post
 
Default

got it sorted now.

from apache error log
[Tue Jan 31 21:55:29 2012] [notice] Graceful restart requested, doing restart
Unable to open logs

on my new virtual host config i have:

CustomLog /var/www/site2/logs/logs/access.log combined

i have repeted logs. so when restart could not open the log file.

__________________
--
Bip
www.makeonlineshop.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix queue problem? murunix Server Operation 7 2nd May 2011 02:55
smtp is error!!! fhawk Installation/Configuration 2 7th April 2009 14:17
Spamsnake - Problem with spamassassin, FuzzyOcr and MySQL debuguser HOWTO-Related Questions 6 16th September 2008 19:37
ISPConfig 2.2.14 released till General 48 20th July 2007 00:46
spamassasin/clamAV not working Daisy Installation/Configuration 32 15th February 2007 01:09


All times are GMT +2. The time now is 09:14.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.