Tricks and Tips about Systems/Network

January 27, 2010

"open_basedir restriction in effect" on Plesk

Filed under: admins,Apache,Linux,PHP,Plesk — Liju Mathew @ 1:14 pm

Question,

I can’t upload images to the web even that folder was given full access to the webserver. Server is Centos5 with Plesk loaded

My error messages should like this,

Wed Jan 27 08:55:57 2010] [error] [client 122.166.23.96] PHP Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.com/httpdocs/PrdImages/1517face.gif) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs:/tmp)

Solution,

1. create a conf. file on /var/www/vhosts/mydomain.com/conf/vhost.conf and added the following entries on it.

php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “none”

php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “none”

then include this file entry on domain.conf file
vi /var/www/vhosts/mydomain.com/conf/httpd.include
then added the following entry at the end of the file inside the virtualhost entry.
Include /var/www/vhosts/mydomain.com/conf/vhost.conf

then, restart apache . I do also disable the running php on safe mode ( webhosting settings) from Plesk control panel for the domain.
[root@mydomain.com ~]# vi /var/www/vhosts/mydomain.com/conf/httpd.include
[root@mydomain.com ~]# vi /var/www/vhosts/mydomain.com/conf/vhost.conf
[root@mydomain.com ~]# /usr/local/psa/admin/sbin/websrvmng -a -v
[root@mydomain.com ~]# service httpd configtest
Syntax OK
[root@mydomain.com ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

After the Apache restart, check the php variables should same as shown below,
open_basedir no value no value
safe_mode Off Off

-njoy

November 12, 2009

Plesk – qmail sending the mails from localhost.localdomain

Filed under: admins,Plesk,qmail — Liju Mathew @ 7:42 pm

Yesterday I have issue with plesk mail.
During the nagios setup on a pleask installed server, I noticed that all the mails which generated from the console showing the suffix localhost.localdomain. Hence it caught moved to spam mail.

My trails are,

1. First checking the mx records properly point to the server
2. Check the /etc/hosts and hostname ( etc/sysconfig/network) whether it’s correctly resolve the hostname
3. Make sure that mx record point to the “mail.myserver.com“. It must have a FQDN.
4. Verifying reverse dns lookup. I created a “PTR’ record of the server ip pointing to the “mail” host record and the server domain.
5. Verifying that smtp server is listening the port 25. Actually Plesk uses qmail smtp to send out the mail and SMTP server (Postfix) was not started during the setup time. So that I can send the mail but not receive any mails.

Finally I found a solution from thread is.

Just change the ” /var/qmail/control/me” file entry to mydomain which was set to localhost.localdomain.com
# echo "mydomain.com" > /var/qmail/control/me

restart qmail and nagios
[root@rc-042 php-5.2.9]# /etc/init.d/qmail restart
[root@rc-042 php-5.2.9]# /etc/init.d/nagios restart

How to verify qmail configured to use my domain.
# /var/qmail/bin/qmail-showctl | less press the key “q” quit from window which must shows
defaulthost: (Default.) Default host name is mydomain.com.

It’s working charm after that. -:)

Note: I have spent few hours to find how the email was send out. I stopped the posfix and verified the port 25 is not listening. But it’s still sending out the mail. Lately I found Plesk is using qmail to send the mail.

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.