When i am trying to setup a new server, most of the time i just used the default settings of Apache. But sometimes if the server is not equipped with enough RAM, the Apache service may consume all the server resources causing server failure. Here is an example for limited the resource comsumption by Apache.
Continue reading
Tag Archives: Ubuntu
Linux – Find the process which occupies a specific port
Either one of the following commands could show you the process which is running a specific port
- lsof -i :<port>
- netstat -tulpn | grep :<port>
Here is an example on my Ubuntu server.
root@li266-91:~# netstat -tulpn | grep :80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 31024/apache2
Apache is running on port 80.
Done =)
Reference: How do I determine which application is using port 8080?
Python – Install a Python2.5 on Ubuntu Lucid @ 2
Another way to install extra Python package is by source.
1. Install the build-essential and gcc.
- sudo apt-get install build-essential gcc
2. Go to your target installation directory (usually i put them in /usr/local), download the source file.
- wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
Python – Install a Python2.5 on Ubuntu Lucid @ 1
A few months ago i was working on a Drupal CDN setup using the Drupal CDN module and File Conveyor written by Wim Leers. But i have some problems when running the File Conveyor. At first, i thought it is because Python version. Ubuntu 10.04 (Lucid) comes with Python 2.6 but i wanna run the File Conveyor in 2.5. (*Finally i found that the switching the Python version would not resolve the problem.)
There are 2 ways to install additional Python package.
By apt-get Continue reading
Amazon S3 – The s3cmd command line tool
Previously i got my GnuPG ready in Mac. Now i need to setup the s3cmd.
Mac – GnuPG Installation
For Mac:
1. Download the s3cmd package @ S3 tools – Download
2. Extract the archive
- tar zxf s3cmd-1.0.1.tar.gz
.htaccess – Invalid command ‘AuthUserFile’, perhaps misspelled or defined by a module not included in the server configuration
I have a previous post which demonstrates how to add HTTP Authentication by .htaccess.
.htaccess – Setting Password For Your Web Folder
But if it does not work and shown the following error in the Apache error log
- /home/ykyuen/public_html/.htaccess: Invalid command ‘AuthUserFile’, perhaps misspelled or defined by a module not included in the server configuration
Linux – Add New User by Command Line
Use the following command to add user with default home folder and bash as default shell.
- useradd -m -s /bin/bash <username>
Done =)
Reference: Create new user account in Ubuntu Linux from command line
Ubuntu/Fedora – Disable Root SSH
For security reason, we’d better disable the root SSH access to server. Follow the steps below. (root privilege is needed)
1. Edit the SSH config file
- Ubuntu – vi /etc/ssh/sshd_config
- Fedora – vi /etc/sshd/sshd_config
Linux – Check File Encoding
The file command also works in Linux. But unlike Mac, u don’t need to have the -I parameter. Continue reading
ImageMagick – Manipulate Image Files by Shell Commands
ImageMagick is built on Ghostscript which i have introduced in the following post previously.
Ghostscript – Convert PDF Cover/Page into PNG
I am working on my Rails project with the Paperclip gem which requires ImageMagick. Installation of ImageMagick in Ubuntu is very simple. Just grab it by apt-get. Continue reading