domain.com and www.domain.com point to different folder - DNS configured

Discussion in 'Installation/Configuration' started by umano, Feb 28, 2010.

  1. umano

    umano New Member

    I did the usual (perfect server lenny) setup, but when try to reach my websites with www I see the standard index.html of ispconfig.

    I set for every domain an A record www that points to the Ip of the website.
    Also I set a subdomain A record and and a new website into ispconfig, but when i try to reach the subdomain (sub.domain.com) I see the master domain (domain.com)

    Thank you

    It seems strange but the content of /var/www/domain.com and /var/www/clients/client1/web17/web are different. www.domain.com point to the first folder and domain.com to the second. When I use ftp to upload files, the files are stored in /var/www/domain.com

    I see in the vhost file there is no "ServerAlias *.domain.com" and the document root folder pointed is /var/www/domain.com and not /var/www/clients/client1/web17/web. Can it be an issue?
     
    Last edited: Feb 28, 2010
  2. till

    till Super Moderator

    Looks to me as if you created tow different websites for domain.com and www.domain.com. Delete the www.domain.com website and then enable auto subdomain www or auto subdomain *. in the domain.com website.
     
  3. umano

    umano New Member

    Sorry if I have answered a long, I want to be sure about what I write this time (quite sure :) ) there were not 2 website, It seemed to be 2 different folder because i tried to see the content of the folders using tab button to list the folder and not ls /var/www etc.

    It's not only this, I was moving from another server in the same network, using the same IP's to avoid to change dns setting, and probably there were problems with vhost conf file.

    For those reasons when i tried to point www.domain.com I saw the ispconfig standard page and when i tried to point a file uploaded via ftp I saw 404.

    Using domain.com and domain.com/file.ext there were no problem.
    I solved using Serveralias *.domain.com as u told me.

    But I think the problem are not finished. I have a wordpress blog, I'm sure it's a server conf issue, because on the old server (ispconfig 3 as well) everything worked perfectly.

    When I run a script I receive this error

    Warning: touch() [function.touch]: Unable to create file ./cache/ecb0b79f00b91ec708ea6bacd212ea8f.jpg because Permission denied in /var/www/clients/client1/web14/web/wp-content/themes/magazeen/timthumb.php on line 150

    I found another post with this solution usin chown (client1 and web 14 are correct and exists)
    chown -R web14:client1 /var/www/clients/client1/web14/

    This is my vhost file

    <Directory /var/www/sub.domain.com>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost 123.123.123.123:80>
    DocumentRoot /var/www/sub.domain.com/web

    ServerName sub.domain.com
    ServerAdmin webmaster@sub.domain.com

    ErrorLog /var/log/ispconfig/httpd/sub.domain.com/error.log

    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html

    <Directory /var/www/sub.domain.com/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /var/www/clients/client1/web14/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    # suexec enabled
    SuexecUserGroup web14 client1
    # mod_php enabled
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@mag.estrobinario.it"
    php_admin_value upload_tmp_dir /var/www/clients/client1/web14/tmp
    php_admin_value session.save_path /var/www/clients/client1/web14/tmp
    php_admin_value open_basedir /var/www/clients/client1/web14/web:/var/www/clients/client1/web14/tmp:/usr/share/php5

    <Directory /var/www/sub.domain.com/web/>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    AllowOverride All
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    </Directory>

    Also doesn't work the uploader (also in php) in wordpress, the only way is to chmod the folder with 777

    Thank you
     
  4. till

    till Super Moderator

    You have to use php-fcgi + suexec or suphp if the web application in a website shall be able to write files into nthe webspace. You currently use mod_php, so wordpress can not create files at the moment.
     
  5. umano

    umano New Member

    Ok done now it works like a charm
    Thanks a lot
     

Share This Page