Archive for the ‘virtualhost’ Category


create /var/www/vhosts/$DOMAIN$/conf/vhost.conf

content:

<DIRECTORY /var/www/vhosts/$DOMAIN$/httpdocs>

<IfModule sapi_apache2.c>

php_admin_flag engine on

# General settings

php_admin_flag safe_mode off

php_admin_value open_basedir "/var/www/vhosts/$DOMAIN$/:/tmp/"

# Performance settings (not mandatory)

php_admin_value memory_limit 512M

php_admin_value max_execution_time 600

php_admin_value max_input_time 300

php_admin_value post_max_size 60M

php_admin_value upload_max_filesize 60M

# Additional directives

</IfModule>

</DIRECTORY>

<DIRECTORY /var/www/vhosts/$DOMAIN$/httpdocs>

<IfModule mod_php5.c>

php_admin_flag engine on

# General settings

php_admin_flag safe_mode off

php_admin_value open_basedir "/var/www/vhosts/$DOMAIN$/:/tmp/"

# Performance settings

php_admin_value memory_limit 512M

php_admin_value max_execution_time 600

php_admin_value max_input_time 300

php_admin_value post_max_size 60M

php_admin_value upload_max_filesize 60M

# Additional directives

   AddHandler php5-script .hph

   AddType text/html .hph

</IfModule>

</DIRECTORY>

/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain $DOMAIN$



and voila..

http://www.linuxscrew.com/2009/12/21/best-of-linux-cheat-sheets/

1. Create a subdomain z-WILDCARD in Plesk – of course in the admin section of the right domain.
Why do we need this name? ’cause this entry should be the last entry in the list of subdomains, otherwise this
“trick” will not work. So if you have a domain as e.g. zabalula , than you should maybe name the subdomain zzzz-WILDCARD
or similar.
2. Add special configuration (catchall for all subdomains) to the vhosts.conf file of this subdomain.
Normally it’s located in /srv/www/vhosts/domain.com/subdomains/z-WILDCARD/conf/vhosts.conf. You have to create it
– normally you need the root user to do this. Copy the following content into the file:
ServerAlias *.domain.com
3. Apply the new configuration – recreate the Apache configuration. You have to run the tool websrvmng which is a
Plesk tool that manages and creates the webserver configuration. Execute the following as root user.
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
4. Finally – restart Apache to load the new configuration, also as root.
apache2ctl restart

create file if not exists: /var/www/vhosts/somedomain.com/conf/vhost.conf
<Directory /var/www/vhosts/somedomain.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=somedomain.com