Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an apache web server on a debian machine. I'm using virtualmin to administer virtual hosts. I have two sites on this server right now, when I try to access one site without the www in the URL I get an access denied. The other site is fine. The site with the problem is a cakephp app and has the following .htaccess file in the public_html folder.

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

Below is the directives for the problem domain.

SuexecUserGroup "#1001" "#1001"
ServerName mydomain.net
ServerAlias www.mydomain.net
ServerAlias webmail.mydomain.net
ServerAlias admin.mydomain.net
DocumentRoot /home/mydomain/public_html
ErrorLog /var/log/virtualmin/mydomain.net_error_log
CustomLog /var/log/virtualmin/mydomain.net_access_log combined
ScriptAlias /cgi-bin/ /home/mydomain/cgi-bin/
ScriptAlias /awstats/ /home/mydomain/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/mydomain/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/mydomain/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.mydomain.net
RewriteRule ^(.*) https://mydomain.net:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.mydomain.net
RewriteRule ^(.*) https://mydomain.net:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 31
<Files awstats.pl>
AuthName "mydomain.net statistics"
AuthType Basic
AuthUserFile /home/mydomain/.awstats-htpasswd
require valid-user
</Files>
share|improve this question
1  
What are the apache error logs telling you about the problem? Have you checked directory permissions? What is the difference to your working configuration? –  Christian Jan 13 '11 at 8:13
    
What happens if you go to mydomain.net/index.php (or other existing page)? Does it work? –  lg. Jan 13 '11 at 11:28
    
cant find entry in error logs, and when i look for index.php it says not found. Also the config is identical to the working host. –  madphp Jan 13 '11 at 15:06
    
The error log should be at /var/log/httpd/error_log under Virtualmin –  Josh Jan 13 '11 at 16:02
    
not updating any logs. tried accessing last modified files. –  madphp Jan 13 '11 at 21:40
add comment

1 Answer

What happens if you exchange ServerName with ServerAlias?

ServerName www.mydomain.net
ServerAlias mydomain.net

Then try to add another fake virtual domain.

share|improve this answer
    
first step doesnt make a difference. I was thinking of adding another virtual domain, but wondering if there was a less messy option. –  madphp Jan 13 '11 at 21:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.