Hello. My name's Kate. I love Linux, WordPress - own a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: available

You are on the Nineteen Labs weblog archives for June, 2007.

OUR ARCHIVES : June 2007

Squid : Ports Restrictions

Add this to squid.conf
#Port Lists
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

or
# Port Lists
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 70 210 1025-65535 280 488 591 777
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

If users in your network access remote servers on non standard HTTP/S ports not listed in squid.conf, your browser will show an error page :

ERROR

The requested URL could not be retrieved

_____

While trying to retrieve the URL: http://xxx.xxx.xxx.xxx:1000 (this is an example)

The following error was encountered:

* Access Denied.

Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.

Your cache administrator is webmaster.

This ports restriction help limit unauthorized request.

Upgrading php and mysql (cPanel using WHM)

Upgrading cPanel is a lot easy than upgrading Plesk, especially if we use WHM (Web Hosting Manager).

1. Log into WHM
2. Go to Apache Update in Software Category
3. Click Load Previous Config, uncheck previous php version and check the new php version. Same with mysql
4. Press Start Build

Note : some components also provided, such as xml-rpc, not just php and mysql. So read through options available in Apache Update, before Start Build

Turn On and Update Plesk Stat

Stat in one of servers is turn off and doesn’t updating for two days.

Check ‘root’ user crontab
crontab -l

output : 7 4 * * * /usr/local/psa/admin/sbin/statistics >/dev/null 2>&1

Check cron logs for records about the statistic utility executions
vi /var/log/cron

Check apache logs size. Make sure no bigger than 2GB.

Check database directories (mysql : /var/lib/mysql) have read/write permissions to ‘mysql’ user

If every conditions above fit with your settings, then we must Run :
/usr/local/psa/admin/sbin/statistics (for all sites in one server)

or

usr/local/psa/admin/sbin/statistics �calculate-one �domain-name=domain.com (only for one specific domain)

Art : Brilliant and Amazing Bus Ads

Art can be everywhere.
Inventor Spot shows some of great, brilliant and amazing Bus Ads.

After reboot, squid -k can not send stop signal again

If reboot and squid -k says it can not send stop signal again, means that squid.pid is missing
Check squid.pid in the system and if missing, here is what i can suggest :
Look into a previous post in this website, then shutdown squid
squid -k shutdown

Create squid.pid (usually squid.pid located in the same directory with log files)
touch squid.pid

squid.pid chmod permission
-rw-r--r--

squid.pid chown permission
root : squid

Since it’s empty, we must make Squid to rewrite a squid.pid file
Create Squid swap directories
squid -z

Run Squid
squid

then try reboot

Squid -k problem : can not send stop signal

The squid.pid file is missing or unreadable makes squid -k command don’t work (says it can not send stop signal). We kill Squid manually by finding the process ID with ps.

ps ax | grep squid

If there are more than one Squid process, be sure to kill the one that shows up as (squid).
example
500 ?? Is 0:00.01 squid -sD
505 ?? S 0:00.27 (squid) -sD (squid)

then kill it
kill -TERM 505

How to fix this? I learn that with a help from Squid Faq
Run squid again
squid

then do ps again
ps ax | grep squid

find squid process that shows up as (squid)
example : if the process id 82675 (remember this is example)
Create the PID file and put the process id number there
echo 82675 > /usr/local/squid/logs/squid.pid
note : /usr/local/squid/logs/squid.pid (location of squid.pid, this is probably different in your computer)

Then find the Squid process id. Send the process a HUP signal, which is the same as squid -k reconfigure
kill -HUP 82675
The reconfigure process creates a new PID file automatically.

4 things about Squid Swap Directories

A few things you need to know about Squid Swap Directories
1. Do not erase or delete using linux delete command. It can cause Swap Directories DIRTY.
2. You do not need to erase or delete Squid Swap Directories if you have no_cache deny (an instruction in squid for no-cache proxy) in squid.conf. Squid need that Swap Directories
3. Shutdown Squid before recreates Swap Directories.
4. If you recreates Swap Directories, disconnect any request to Squid. It can cause you a problem, in my experience, i can’t shutdown Squid properly in next event

VI command (essential)

I think this commands essential, because with this (only eight) commands you can create and edit various files with VI

i Insert new text, before the cursor.
escape/ESC
Once you’ve entered input mode using the one of the a, i, O or o commands, use escape or ESC to quit entering text and return to command mode.
yy Copy the line the cursor is on
dd Delete the line the cursor is on.:w
Write the file back to the file with the name that you originally used as an argument on the vi command line.
:w or :w!
Write the file back to the file with the name that you originally used as an argument on the vi command line.
:w file_name
Write the file back to the file with the name “file_name”.
:q!
Quit, discarding any modifications that you may have made.
:wq!
Write the file back to the file with the name that you originally used as an argument on the vi command line and Quit

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu