I try to created a domain with admin user, but is return for all domain Error: domain test2.2o.cl exist (for example), is rare because a use a clean machine and new vesta install for this.
So a created a test user and packages, and now is work:
Code: Select all
[root@vesta ~]# v-list-user-package testpackage
PACKAGE: testpackage
TEMPLATE: phpfcgid
WEB_DOMAINS: 10
WEB_ALIASES: 10
DNS_DOMAINS: 10
DNS_RECORDS: 10
MAIL_DOMAINS: 10
MAIL_ACCOUNTS: 10
DATABASES: 10
CRON_JOBS: 10
DISK_QUOTA: 1000
BANDWIDTH: 10000
NS: vesta.inf.utfsm.cl,vesta.inf.utfsm.cl
SHELL: bash
BACKUPS: 10
TIME: 12:57:05
DATE: 2013-01-10
Code: Select all
[root@vesta ~]# v-list-user test
USER: test
FNAME: test
LNAME: test
PACKAGE: testpackage
TEMPLATE: phpfcgid
WEB_DOMAINS: 10
WEB_ALIASES: 10
DNS_DOMAINS: 10
DNS_RECORDS: 10
MAIL_DOMAINS: 10
MAIL_ACCOUNTS: 10
DATABASES: 10
CRON_JOBS: 10
DISK_QUOTA: 1000
BANDWIDTH: 10000
NS: vesta.inf.utfsm.cl,vesta.inf.utfsm.cl
SHELL: bash
BACKUPS: 10
CONTACT: [email protected]
CRON_REPORTS: yes
RKEY: 5wf5Av6fcG
SUSPENDED: no
SUSPENDED_USERS: 0
SUSPENDED_WEB: 0
SUSPENDED_DNS: 0
SUSPENDED_MAIL: 0
SUSPENDED_DB: 0
SUSPENDED_CRON: 0
IP_AVAIL: 1
IP_OWNED: 0
U_USERS: 0
U_DISK: 0
U_DISK_DIRS: 0
U_DISK_WEB: 0
U_DISK_MAIL: 0
U_DISK_DB: 0
U_BANDWIDTH: 0
U_WEB_DOMAINS: 0
U_WEB_SSL: 0
U_WEB_ALIASES: 0
U_DNS_DOMAINS: 0
U_DNS_RECORDS: 0
U_MAIL_DOMAINS: 0
U_MAIL_DKIM: 0
U_MAIL_ACCOUNTS: 0
U_DATABASES: 0
U_CRON_JOBS: 0
U_BACKUPS: 0
TIME: 10:00:47
DATE: 2013-01-10
Ok, now a test domain:
Code: Select all
[root@vesta ~]# v-list-web-domain test test2.2o.cl
DOMAIN: test2.2o.cl
IP: 204.87.169.78
IP6: NULL
U_DISK: 0
U_BANDWIDTH: 0
TPL: phpfcgid
ALIAS: www.test2.2o.cl
CGI: yes
ELOG: yes
STATS: NULL
STATS_USER: NULL
SSL: no
SSL_HOME: same
FTP_USER: NULL
NGINX: default
NGINX_EXT: jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,exe,pdf,doc,xls,ppt,txt,odt,ods,odp,odf,tar,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm
SUSPENDED: no
TIME: 10:02:36
DATE: 2013-01-10
The apache configuration:
Code: Select all
[root@vesta ~]# cat /home/test/conf/web/httpd.conf
<VirtualHost 204.87.169.78:8080>
ServerName test2.2o.cl
ServerAlias www.test2.2o.cl
ServerAdmin [email protected]
DocumentRoot /home/test/web/test2.2o.cl/public_html
ScriptAlias /cgi-bin/ /home/test/web/test2.2o.cl/cgi-bin/
Alias /vstats/ /home/test/web/test2.2o.cl/stats/
Alias /error/ /home/test/web/test2.2o.cl/document_errors/
SuexecUserGroup test test
CustomLog /var/log/httpd/domains/test2.2o.cl.bytes bytes
CustomLog /var/log/httpd/domains/test2.2o.cl.log combined
ErrorLog /var/log/httpd/domains/test2.2o.cl.error.log
<Directory /home/test/web/test2.2o.cl/public_html>
AllowOverride AuthConfig FileInfo Indexes Limit
Options +Includes -Indexes +ExecCGI
php_admin_flag engine off
AddHandler fcgid-script .php
FCGIWrapper /home/test/web/test2.2o.cl/cgi-bin/fcgi-starter .php
</Directory>
<Directory /home/test/web/test2.2o.cl/stats>
AllowOverride All
</Directory>
Include /home/test/conf/web/httpd.test2.2o.cl.conf*
</VirtualHost>
The permissions:
Code: Select all
[root@vesta ~]# ls -all /home/test/web/test2.2o.cl/cgi-bin/
total 12
drwxr-x--x. 2 test test 4096 ene 10 10:02 .
dr-xr-x--x. 9 test test 4096 ene 10 10:02 ..
-rwxr-x--x. 1 test test 119 ene 10 10:02 fcgi-starter
[root@vesta ~]# ls -all /home/test/web/test2.2o.cl/public_html/
total 16
drwxrwx--x. 2 test test 4096 ene 10 10:02 .
dr-xr-x--x. 9 test test 4096 ene 10 10:02 ..
-rw-rw-r-x. 1 test test 1045 ene 10 10:02 index.html
-rw-rw-r-x. 1 test test 65 ene 10 10:02 robots.txt
The wrapper content:
Code: Select all
[root@vesta ~]# cat /home/test/web/test2.2o.cl/cgi-bin/fcgi-starter
#!/bin/sh
PHPRC=/etc/
export PHPRC
export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=8
exec /usr/bin/php-cgi
Now a try:
Code: Select all
[root@vesta ~]# su - test
[test@vesta ~]$ id
uid=502(test) gid=502(test) groups=502(test) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[test@vesta ~]$ pwd
/home/test
[test@vesta ~]$ echo -e "<?php \n phpinfo(); \n?>" > web/test2.2o.cl/public_html/index.php
[test@vesta ~]$ cat web/test2.2o.cl/public_html/index.php
<?php
phpinfo();
?>
[test@vesta ~]$ ls -all web/test2.2o.cl/public_html/
total 20
drwxrwx--x. 2 test test 4096 Jan 10 10:30 .
dr-xr-x--x. 9 test test 4096 Jan 10 10:02 ..
-rw-rw-r-x. 1 test test 1045 Jan 10 10:02 index.html
-rw-rw-r--. 1 test test 23 Jan 10 10:33 index.php
-rw-rw-r-x. 1 test test 65 Jan 10 10:02 robots.txt
Result:
And the process:
Code: Select all
[root@vesta ~]# ps aux | grep test
root 19227 0.0 0.3 97828 3868 ? Ss 10:27 0:00 sshd: test [priv]
test 19231 0.0 0.1 97828 1908 ? S 10:27 0:00 sshd: test@pts/1
test 19232 0.0 0.1 110508 1952 pts/1 Ss+ 10:27 0:00 -bash
root 21046 0.0 0.0 105304 920 pts/0 S+ 11:08 0:00 grep test
###################################################################################################
Ok, if look this file:
Code: Select all
[root@vesta ~]# cat /etc/httpd/conf.d/php.conf
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule !prefork.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
# SetHandler application/x-httpd-php-source
#</FilesMatch>
#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
[root@vesta ~]# vim /etc/httpd/conf.d/php.conf
Now i comment the block with SetHandler:
Code: Select all
[root@vesta ~]# vim /etc/httpd/conf.d/php.conf
[root@vesta ~]# cat /etc/httpd/conf.d/php.conf
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule !prefork.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
#<FilesMatch \.php$>
# SetHandler application/x-httpd-php
#</FilesMatch>
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
# SetHandler application/x-httpd-php-source
#</FilesMatch>
#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
Apache reload:
Code: Select all
[root@vesta ~]# /etc/init.d/httpd reload
Result:
The process:
Code: Select all
[root@vesta ~]# ps aux | grep test
root 19227 0.0 0.3 97828 3868 ? Ss 10:27 0:00 sshd: test [priv]
test 19231 0.0 0.1 97828 1908 ? S 10:27 0:00 sshd: test@pts/1
test 19232 0.0 0.1 110508 1952 pts/1 Ss+ 10:27 0:00 -bash
test 20250 0.0 1.2 335096 13152 ? Ss 10:47 0:00 /usr/bin/php-cgi
test 20252 0.0 0.7 335228 7580 ? S 10:47 0:00 /usr/bin/php-cgi
test 20253 0.0 0.5 335096 6120 ? S 10:47 0:00 /usr/bin/php-cgi
test 20254 0.0 0.5 335096 6120 ? S 10:47 0:00 /usr/bin/php-cgi
test 20255 0.0 0.5 335096 5192 ? S 10:47 0:00 /usr/bin/php-cgi
test 20256 0.0 0.5 335096 5192 ? S 10:47 0:00 /usr/bin/php-cgi
test 20257 0.0 0.5 335096 5192 ? S 10:47 0:00 /usr/bin/php-cgi
test 20258 0.0 0.5 335096 5192 ? S 10:47 0:00 /usr/bin/php-cgi
test 20259 0.0 0.5 335096 5192 ? S 10:47 0:00 /usr/bin/php-cgi
root 21029 0.0 0.0 105304 920 pts/0 S+ 11:06 0:00 grep test