Re: httpd.conf problem with defaults

2013-04-06 Thread John Tate
Removed all the NameVirtualHost lines and it still isn't working. I can't
make sense of it everything looks fine, I get some errors about _default_
VirtualHost.

# apachectl startssl
[Sat Apr  6 02:53:57 2013] [warn] module mod_php5.c is already added,
skipping
[Sat Apr  6 02:53:57 2013] [warn] module php5_module is already loaded,
skipping
[Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port 80,
the first has precedence
[Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port 80,
the first has precedence



On Fri, Apr 5, 2013 at 7:25 PM, Stuart Henderson s...@spacehopper.orgwrote:

 On 2013-04-05, John Tate j...@johntate.org wrote:
  NameVirtualHost 127.0.0.1:443
  NameVirtualHost 208.79.92.130:443
  NameVirtualHost 127.0.0.1:80
  NameVirtualHost 127.0.0.1:80
  NameVirtualHost 127.0.0.1:80
  NameVirtualHost 208.79.92.130:80
  NameVirtualHost 208.79.92.130:80
  NameVirtualHost 208.79.92.130:80

 remove the duplicate lines and see if it helps.




-- 
www.johntate.org



Re: httpd.conf problem with defaults

2013-04-06 Thread Nicolai
On Fri, Apr 05, 2013 at 02:18:42PM +1100, John Tate wrote:
 I'm getting these warnings:

What's the output of 'apachectl configtest' ?

Nicolai



Re: httpd.conf problem with defaults

2013-04-06 Thread Zé Loff
On Sat, Apr 06, 2013 at 08:55:53PM +1100, John Tate wrote:
 Removed all the NameVirtualHost lines and it still isn't working. I can't
 make sense of it everything looks fine, I get some errors about _default_
 VirtualHost.
 
 # apachectl startssl
 [Sat Apr  6 02:53:57 2013] [warn] module mod_php5.c is already added,
 skipping
 [Sat Apr  6 02:53:57 2013] [warn] module php5_module is already loaded,
 skipping
 [Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port 80,
 the first has precedence
 [Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port 80,
 the first has precedence
 
 
 
 On Fri, Apr 5, 2013 at 7:25 PM, Stuart Henderson s...@spacehopper.orgwrote:
 
  On 2013-04-05, John Tate j...@johntate.org wrote:
   NameVirtualHost 127.0.0.1:443
   NameVirtualHost 208.79.92.130:443
   NameVirtualHost 127.0.0.1:80
   NameVirtualHost 127.0.0.1:80
   NameVirtualHost 127.0.0.1:80
   NameVirtualHost 208.79.92.130:80
   NameVirtualHost 208.79.92.130:80
   NameVirtualHost 208.79.92.130:80
 
  remove the duplicate lines and see if it helps.
 
 
 
 
 -- 
 www.johntate.org
 

Apache is telling you what is wrong. You have several default VHs, and
the first (for port 80 it's johntate.org) has precedence, so that's why
you always get redirected to it.

Try changing the NameVirtualHost directives to *:80 and *:443. You are
specifying IP addresses on those directives, but then define
virtual hosts on *:80 and *:443, and maybe that's the problem (I've
moved from apache to nginx, so I'm not testing any of this...). Here's
a (very trimmed) known-to-work config:

ServerName www.phistat.com
DocumentRoot /var/www/htdocs
UseCanonicalName On

NameVirtualHost *:80
NameVirtualHost *:443

VirtualHost *:80
ServerAdmin webmas...@zeloff.org
DocumentRoot/var/www/htdocs
ServerName  www.zeloff.org
ErrorLoglogs/error_log
CustomLog   logs/access_log combined
Directory /var/www/htdocs/fdm
Options Multiviews
FollowSymLinks
AllowOverride   None
Order   
allow,deny
Allow from  all
/Directory
/VirtualHost

VirtualHost *:80
ServerAdmin webmas...@phistat.com
DocumentRoot/var/www/htdocs/phiStat
ServerName  www.phistat.com
ErrorLog
logs/www.phistat.com-error_log
CustomLog   
logs/www.phistat.com-access_log combined
/VirtualHost

Additionally you are adding the php modules twice: in your httpd.conf file and
most likely on *.conf files present on the /var/www/conf/modules folder,
which you are including with the Include /var/www/conf/modules/*.conf
line, but this has nothing to do with the redirections.


-- 



Re: httpd.conf problem with defaults

2013-04-06 Thread John Tate
Thanks, that worked.


On Sun, Apr 7, 2013 at 6:45 AM, Zé Loff zel...@zeloff.org wrote:

 On Sat, Apr 06, 2013 at 08:55:53PM +1100, John Tate wrote:
  Removed all the NameVirtualHost lines and it still isn't working. I can't
  make sense of it everything looks fine, I get some errors about _default_
  VirtualHost.
 
  # apachectl startssl
  [Sat Apr  6 02:53:57 2013] [warn] module mod_php5.c is already added,
  skipping
  [Sat Apr  6 02:53:57 2013] [warn] module php5_module is already loaded,
  skipping
  [Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port
 80,
  the first has precedence
  [Sat Apr  6 02:53:57 2013] [warn] _default_ VirtualHost overlap on port
 80,
  the first has precedence
 
 
 
  On Fri, Apr 5, 2013 at 7:25 PM, Stuart Henderson s...@spacehopper.org
 wrote:
 
   On 2013-04-05, John Tate j...@johntate.org wrote:
NameVirtualHost 127.0.0.1:443
NameVirtualHost 208.79.92.130:443
NameVirtualHost 127.0.0.1:80
NameVirtualHost 127.0.0.1:80
NameVirtualHost 127.0.0.1:80
NameVirtualHost 208.79.92.130:80
NameVirtualHost 208.79.92.130:80
NameVirtualHost 208.79.92.130:80
  
   remove the duplicate lines and see if it helps.
  
  
 
 
  --
  www.johntate.org
 

 Apache is telling you what is wrong. You have several default VHs, and
 the first (for port 80 it's johntate.org) has precedence, so that's why
 you always get redirected to it.

 Try changing the NameVirtualHost directives to *:80 and *:443. You are
 specifying IP addresses on those directives, but then define
 virtual hosts on *:80 and *:443, and maybe that's the problem (I've
 moved from apache to nginx, so I'm not testing any of this...). Here's
 a (very trimmed) known-to-work config:

 ServerName www.phistat.com
 DocumentRoot /var/www/htdocs
 UseCanonicalName On

 NameVirtualHost *:80
 NameVirtualHost *:443

 VirtualHost *:80
 ServerAdmin webmas...@zeloff.org
 DocumentRoot/var/www/htdocs
 ServerName  www.zeloff.org
 ErrorLoglogs/error_log
 CustomLog   logs/access_log combined
 Directory /var/www/htdocs/fdm
 Options Multiviews
 FollowSymLinks
 AllowOverride   None
 Order
   allow,deny
 Allow from  all
 /Directory
 /VirtualHost

 VirtualHost *:80
 ServerAdmin
 webmas...@phistat.com
 DocumentRoot/var/www/htdocs/phiStat
 ServerName  www.phistat.com
 ErrorLog
  logs/www.phistat.com-error_log
 CustomLog
 logs/www.phistat.com-access_log combined
 /VirtualHost

 Additionally you are adding the php modules twice: in your httpd.conf file
 and
 most likely on *.conf files present on the /var/www/conf/modules folder,
 which you are including with the Include /var/www/conf/modules/*.conf
 line, but this has nothing to do with the redirections.


 --




--
www.johntate.org



Re: httpd.conf problem with defaults

2013-04-05 Thread Stuart Henderson
On 2013-04-05, John Tate j...@johntate.org wrote:
 NameVirtualHost 127.0.0.1:443
 NameVirtualHost 208.79.92.130:443
 NameVirtualHost 127.0.0.1:80
 NameVirtualHost 127.0.0.1:80
 NameVirtualHost 127.0.0.1:80
 NameVirtualHost 208.79.92.130:80
 NameVirtualHost 208.79.92.130:80
 NameVirtualHost 208.79.92.130:80

remove the duplicate lines and see if it helps.



httpd.conf problem with defaults

2013-04-04 Thread John Tate
I think I have a problem with my defaults. I used to just have a default a
secusrvr.com. The default would point to /var/www/htdocs which redirects to
/var/www/sites/secusrvr.com which is for the virtualhost secusrvr.com. I
added johntate.org and www.johntate.org both under /var/www/sites/
www.johntate.org and /var/www/sites/johntate.org but somehow even after
adding www.secusrvr.com, that domain through a browser redirects to
johntate.org. I'm getting these warnings:
# apachectl startssl
[Thu Apr  4 20:17:56 2013] [warn] module mod_php5.c is already added,
skipping
[Thu Apr  4 20:17:56 2013] [warn] module php5_module is already loaded,
skipping
[Thu Apr  4 20:17:56 2013] [warn] _default_ VirtualHost overlap on port 80,
the first has precedence
[Thu Apr  4 20:17:56 2013] [warn] _default_ VirtualHost overlap on port 80,
the first has precedence
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 208.79.92.130:443 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 208.79.92.130:80 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 208.79.92.130:80 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 208.79.92.130:80 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 127.0.0.1:443 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 127.0.0.1:80 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 127.0.0.1:80 has no
VirtualHosts
[Thu Apr  4 20:17:56 2013] [warn] NameVirtualHost 127.0.0.1:80 has no
VirtualHosts
/usr/sbin/apachectl startssl: httpd started



Here is my /var/www/conf/httpd.conf
#   $OpenBSD: httpd.conf,v 1.26 2009/06/03 18:28:21 robert Exp $
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See URL:http://www.apache.org/docs/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# After this file is processed, the server will look for and process
# /var/www/conf/srm.conf and then /var/www/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as
a
# whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default'
server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with / (or drive:/ for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with /, the value of ServerRoot is prepended -- so logs/foo.log
# with ServerRoot set to /usr/local/apache will be interpreted by the
# server as /usr/local/apache/logs/foo.log.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported
on
# Unix platforms.
#
ServerType standalone

#
# ServerTokens is either Full, OS, Minimal, or ProductOnly.
# The values define what version information is returned in the
# Server header in HTTP responses.
#
# ServerTokens ProductOnly

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at URL:http://www.apache.org/docs/mod/core.html#lockfile);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot /var/www

#
# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename.
#
#LockFile logs/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile 

Re: httpd.conf problem with defaults

2013-04-04 Thread John Tate
Nice and short httpd.conf...
ServerType standalone
ServerRoot /var/www
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
MaxCPUPerChild 0
MaxDATAPerChild 0
MaxNOFILEPerChild 0
MaxRSSPerChild 0
MaxSTACKPerChild 0
 LoadModule rewrite_module  /usr/lib/apache/modules/mod_rewrite.so
LoadModule php5_module /usr/local/lib/php-5.3/libphp5.so
AddModule mod_php5.c
Include /var/www/conf/modules/*.conf
Port 80
IfDefine SSL
Listen 80
Listen 443
/IfDefine
User www
Group www
ServerAdmin j...@secusrvr.com
ServerName www.secusrvr.com
DocumentRoot /var/www/htdocs
Directory /
Options FollowSymLinks
AllowOverride None
/Directory
Directory /var/www/htdocs
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
/Directory
UserDir disabled
DirectoryIndex index.php index.html
AccessFileName .htaccess
Files .htaccess
Order allow,deny
Deny from all
/Files
UseCanonicalName On
TypesConfig conf/mime.types
DefaultType text/plain
IfModule mod_mime_magic.c
MIMEMagicFile conf/magic
/IfModule
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
LogFormat %h %l %u %t \%r\ %s %b \%{Referer}i\ \%{User-Agent}i\
combined
LogFormat %h %l %u %t \%r\ %s %b common
LogFormat %{Referer}i - %U referer
LogFormat %{User-agent}i agent
CustomLog logs/access_log common
Alias /icons/ /var/www/icons/
Directory /var/www/icons
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
/Directory
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
Directory /var/www/cgi-bin
AllowOverride None
Options None
Order allow,deny
Allow from all
/Directory
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
LanguagePriority en fr de
AddType application/x-httpd-php .php
BrowserMatch Mozilla/2 nokeepalive
BrowserMatch MSIE 4\.0b2; nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch RealPlayer 4\.0 force-response-1.0
BrowserMatch Java/1\.0 force-response-1.0
BrowserMatch JDK/1\.0 force-response-1.0
Location /server-status
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
/Location
IfDefine SSL
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl.crl
/IfDefine
IfModule mod_ssl.c
SSLPassPhraseDialog  builtin
SSLSessionCache dbm:logs/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  sem
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLRandomSeed startup file:/dev/arandom  512
SSLLog  logs/ssl_engine_log
SSLLogLevel info
/IfModule
NameVirtualHost 208.79.92.130:443
NameVirtualHost 127.0.0.1:443
VirtualHost *:443
DocumentRoot /var/www/sites/secusrvr.com
ServerName secusrvr.com
SSLEngine on
SSLCertificateFile/etc/ssl/private/secusrvr.com.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLCACertificateFile/etc/ssl/private/gd_bundle.crt
CustomLog logs/ssl_request_log \
  %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
Directory /var/www/sites/secusrvr.com
allow from all
Options +Indexes
AllowOverride All
/Directory
/VirtualHost
NameVirtualHost 208.79.92.130:80
NameVirtualHost 127.0.0.1:80
VirtualHost *:80
DocumentRoot /var/www/sites/johntate.org
ServerName johntate.org
Directory /var/www/sites/johntate.org
allow from all
Options +Indexes
AllowOverride All
/Directory
/VirtualHost
NameVirtualHost 208.79.92.130:80
NameVirtualHost 127.0.0.1:80
VirtualHost *:80
DocumentRoot /var/www/sites/www.johntate.org
ServerName www.johntate.org
Directory /var/www/sites/www.johntate.org
allow from all
Options +Indexes
AllowOverride All
/Directory
/VirtualHost
NameVirtualHost 208.79.92.130:80
NameVirtualHost