Showing posts with label cpanel. Show all posts
Showing posts with label cpanel. Show all posts

Sunday, March 18, 2012

nginxcp pythonfix [solved]

http://nginxcp.com/forums/Thread-installation-error?page=2

easy_install Pyyaml==3.09
rm /usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg

nginxcp tells about pythonfix
Note:
You may needed to run pythonfix script if you are installing it in first time.

before:

Traceback (most recent call last):
  File "/usr/local/src/publicnginx/nginxinstaller2", line 9, in ?
    import createvhosts
  File "/usr/local/src/publicnginx/createvhosts.py", line 2, in ?
    import yaml
  File "/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/__init__.py", line 26
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

After:
 Reading Apache Configuration
 updating Apache configuration
 ****************************************************
 *               Installation Complete              *
 *run /etc/init.d/httpd restart to start Nginx Admin*
 ****************************************************
Done! :)

Sunday, May 15, 2011

faster than original cpanel

i use nginx as cpanel wrapper.

server {
error_log /var/log/nginx/vhost-error_log warn;
# Use alternative port eg: port 2073
listen _PUBLIC_IP_:2073;

ssl on;


# redirect error page ssl
# this prevent nginx error 400 http://nginx.org/pipermail/nginx/2009-August/014521.html

error_page 497 https://$host$request_uri;

#ssl on; this can be turned off since the above will automatically enable it
ssl_certificate /etc/ssl/certs/domain.pem;
ssl_certificate_key /etc/ssl/private/domain.key;

server_name domain.com www.domain.com;
access_log /usr/local/apache/domlogs/domain.com-bytes_log bytes_log;
access_log /usr/local/apache/domlogs/domain.com combined;
root /home/smartcha/public_html;
location / {
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
expires 7d;
try_files $uri @backend;
#try_files $uri @redirSSL;
}
error_page 405 = @backend;

add_header X-Cache "HIT from Backend";
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
}
#try n error by apis
#location @redirSSL {
#proxy_connect_timeout 15;
#proxy_redirect off;
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto https;
#}
location @backend {
internal;
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
proxy_set_header X-Forwarded-Proto https;
}
location ~ .*\.(php|jsp|cgi|pl|py)?$ {
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
}
location ~ /\.ht {
deny all;
}
}

now you can access http://domain.com:2073

Thursday, May 05, 2011

nginx pid error (using nginxcp)

pid      /var/run/nginx.pid;

error:
fopen `/var/run/nginx.pid': No such file or directory [ ok ]

reference: http://bugs.alpinelinux.org/issues/559

vi /etc/nginx/nginx.conf

add

pid /var/run/nginx.pid;

between worker process and error log line.

kill previous nginx process

now you can use:

service nginx restart
success!!

alternative ./configure --pid-path=/var/run/nginx.pid

Saturday, April 16, 2011

nginx made me happy

no more incomplete page. fast loading, stable and very enjoy made me want to lompat lompat.

mysql load also reduced.

Friday, April 15, 2011

nginxcp made easy

for all cpanel administrators i recomend using nginx.

yesterday, new release was found.

Nginx Admin (Stable version) v2.3 released

this is using newest nginx 10
read more http://nginxcp.com/forums/Thread-nginx-admin-stableversion-v2-3-released

don't forget to visit main website http://nginxcp.com/

now i'm using nginx and very happy on performance and there are nginx control panel in whm >> plugin too.. :)

Monday, April 11, 2011

install domainkey on cpanel

http://karthickv.wordpress.com/2008/06/28/how-to-install-domain-keys-on-a-cpanel-server/

/usr/local/cpanel/bin/domain_keys_installer username  It will install for the domain (test.com) successfully. Now you can verify it from the db record of the domain. The following new entry will be added in the db record.
vi /var/named/test.com.db  default._domainkey.username IN TXT "k=rsa; p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAOmrn9fVOia0KET1UwIDAQAB;"  rndc reload test.com Restart exim service.

Now you can verify it by creating a new mail account test123@test.com and send an email to yahoo account, then verify the headers.

Return-Path:        Authentication-Results:  mta398.mail.re4.yahoo.com from=test.com; domainkeys=pass (ok) Received:    from mta398.mail.re4.yahoo.com with SMTP; Sun, 27 Apr 2008 03:49:29 -0700 DomainKey-Signature:     a=rsa-sha1; q=dns; c=nofws; s=default; d=test.com; 9BZnoI9FAPMSTPY;  From the above headers you can confirm that domain key is working fine for
another reference
http://www.sohailriaz.com/how-to-add-domainkeys-and-spf-records-on-cpanel-servers/
this is my script
#!/usr/bin/perl print “\nStarting install of Domainkeys\n”; my %OPTS = @ARGV; my $user = $OPTS{‘user’}; system(“/usr/local/cpanel/bin/domain_keys_installer”,$user); system(“/usr/local/cpanel/bin/spf_installer”,$user); print “\nDone with install of Domainkeys\n”;exit;

Monday, April 04, 2011

Max concurrent user

http://forums.cpanel.net/f189/how-raise-maxclient-apache-2-2-16-a-170946.html

Place the limits in /usr/local/apache/conf/includes/pre_main_global.conf file for ServerLimit and MaxClients instead, then run the following commands:

Code:
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak101029 /usr/local/cpanel/bin/apache_conf_distiller --update /scripts/rebuildhttpdconf /etc/init.d/httpd restart
This will backup your current httpd.conf, run the distiller to distill the changes in the include file, rebuild Apache configuration file, then restart Apache.

Sunday, March 20, 2011

secure tmp folder for cpanel

this is shortcut if you do not want to manually edit file

http://apis17.blogspot.com/2011/03/how-to-secure-tmp.html

use command

/scripts/securetmp

Tuesday, March 15, 2011

how to secure tmp

Step 1: Securing /tmp
Step 1.1: Backup your fstab file

cp /etc/fstab /etc/fstab.bak

Step 1.2: Creating tmpmnt partition file (Around 1Gb in size)

cd /var
dd if=/dev/zero of=tmpMnt bs=1024 count=1048576

Step 1.3: Format the new partition

mkfs.ext3 -j /var/tmpMnt

Press Y when asked
Step 1.4: Making backup of old /tmp

cp -Rp /tmp /tmp_backup

Step 1.5: Mount the tmp filesystem

mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp

Step 1.6: Set the right permissions

chmod 0777 /tmp

Step 1.7: Copy the files back to new tmp folder

cp -Rp /tmp_backup/* /tmp/

Step 1.8: Adding new /tmp filesystem to fstab

echo "/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0" >> /etc/fstab

Step 2: No need for 2 tmp filesystems, so we symlink /var/tmp to /tmp

rm -rf /var/tmp/
ln -s /tmp/ /var/tmp

Thursday, February 17, 2011

cpanel error logs

/usr/local/cpanel/logs/access_log

/usr/local/cpanel/logs/*

/usr/local/cpanel/logs/access_log

/usr/local/apache/logs/error_log

Related Posts Plugin for WordPress, Blogger...