Star / Stop / Restart Apache 2 Web Server
->
Q. How do I restart Apache 2 Web Server under Debian / Ubuntu Linux?
A. Apache is primarily used to serve both static content and dynamic Web pages on the World Wide Web. Many web applications are designed expecting the environment and features that Apache provides.
First, login to server using ssh. To ssh to your server, you will need to a ssh client like putty (download putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).
The ssh client will need you to enter the IP, username and password of your server. Choose port as 22.
Once logged in type the following commands as need be.
How To start Apache 2 web server, enter:
# /etc/init.d/apache2 startOR
$ sudo /etc/init.d/apache2 startLinux Command to restart Apache 2 web server, enter:
# /etc/init.d/apache2 restartIf you are using Ubuntu use sudo:
$ sudo /etc/init.d/apache2 restartHow To stop Apache 2 web server, enter:
# /etc/init.d/apache2 stopOR
$ sudo /etc/init.d/apache2 stop
How to enable mod_rewrite in apache 2.2 in Debian and Ubuntu
->
I am going to describe how to enable mod_rewrite in apache2.2 - specaily for debian.
In default installion of apache2.2 on debian never enable mod_rewrite default. So you may need to enable.
debian user please use “su” before start this process
ubuntu user please use “sudo su” before start this process
- First install the apache2.2 with this command :
apt-get install apache2
(it will install apache 2.2)
now use locate to find if the mod_rewrite.so is availble on your server
updatedb locate mod_rewrite.so
it will found in “/usr/lib/apache2/modules”
new apache follow some folders to enable and desuable mods.
so now do this:
cd /etc/apache2/mods-enabled touch rewrite.load gedit rewrite.load
(you may use any editor to edit this file)
now paste this following line
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
Then edit /etc/apache2/sites-available/000-default
Find the following
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
and change it to
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
and finally restart Apache
/etc/init.d/apache2 restart
OK, you done
Don’t forget to comment, if it works or not.
Install the Latest PostgreSQL Yum Repository for CentOS
Keeping PostgreSQL updated via yum should be done via the pgdg yum repository supplied by pgsqlrpms.org.
The latest CentOS PostgreSQL repo can be viewed here.
You will need to download the repo and then install using rpm as shown below.
wget http://yum.pgsqlrpms.org/reporpms/8.4/pgdg-centos-8.4-1.noarch.rpm</span></div> <div style="width: 506px;">rpm<span> -Uhv</span><span> pgdg-centos-8.4-1.noarch.rpm
Another helpful postgresql install and management link is located here.
How to Install the Latest git on CentOS 5 from Source
To install the latest git on CentOS 5 you will need to install from source since the yum repos are typically fairly far behind. Follow the instructions below and installing git will be a snap.
- Install Dependencies: First we need to install a couple packages via yum to cover the dependencies for building git from source.
[root@server ~]#cd /usr/local/src [root@server ~]# wget http://www.kernel.org/pub/software/scm/git/git-1.6.0.4.tar.gz
[root@server ~]#tar -zxvf git-1.6.0.4.tar.gz [root@server ~]#cd git-1.6.0.4 [root@server ~]#make prefix=/usr/local all
[root@server ~]#make prefix=/usr/local/ install
[root@server ~]#cd /usr/local/src [root@server ~]#wget http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.0.4.tar.gz
[root@server ~]#cd /usr/local/share/man [root@server ~]#tar -zxvf /usr/local/src/git-manpages-1.6.0.4.tar.gz
[root@server ~]#git --version [root@server ~]#man git
After following the above steps you should be able to successfully use git.
[root@server ~]#yum install expat-devel
[root@server ~]#yum install gettext-devel
[root@server ~]#yum install openssl-devel
[root@server ~]#yum install zlib-devel
Make a USB Boot CD for Linux Mint
This USB Boot CD can be used to boot Linux Mint 6 from a USB flash drive on computers with a BIOS that does not support booting from USB. Linux Mint is a remix based on Ubuntu. The USB Boot CD uses a grub bootloader to launch the vmlinuz kernel and initrd from the CD, loading the necessary USB drivers, and then proceeds to locate and extract the compressed filesystem from the flash drive.
Please Note: This USB Boot CD should work on most systems. However, it should be noted that the USB Boot CD may not work on really old computers with only USB 1.0 hardware support.
Can be used to boot flash drives created using the Linux Mint USB Install via CD or Linux Mint USB Install via Windows
USB Boot CD for Linux Mint 6 creation essentials:
- PC with a BIOS that does not support booting from USB
- Linux Mint 6 Live CD
- Working CD Drive and USB Port
- USB flash drive with Linux Mint 6 preinstalled
Creating a CD to Boot Linux Mint 6 from USB
The following process will enable you to create a Boot CD that can be used to Boot Linux Mint 6 from a USB Flash Drive on systems that do not natively support booting from USB.
- Insert the Linux Mint 6 Live CD and restart, booting from the CD
- Open a terminal and type mkdir -p usbcdm/boot/grub
- Type cp /usr/lib/grub/i386-pc/stage2_eltorito usbcdm/boot/grub
- Type gedit usbcdm/boot/grub/menu.lst
- Add the following information to your menu.lst file and save it
title Run Linux Mint 6 from USB DISK root (cd) kernel /boot/vmlinuz file=/cdrom/preseed/mint.seed boot=casper noprompt cdrom-detect/try-usb=true persistent quiet splash initrd /boot/initrd.gz boot
- Type cp /cdrom/casper/initrd.gz ~/usbcdm/boot
- Type cp /cdrom/casper/vmlinuz ~/usbcdm/boot
- Type mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o usbcdmint.iso usbcdm
- Burn the usbcdmint.iso to a CD
Booting from the USB Boot CD for Linux Mint
- Shutdown your computer
- Insert the USB Boot CD and your Linux Mint flash drive
- Set your BIOS or Startup Menu to boot from CD
- Start your computer (booting from the CD)
The USB Boot CD should load the necessary USB drivers, detect the filesystem.squashfs on your flash drive, and then proceed to boot Linux Mint 6 from the flash drive.
Install easy_install Via yum on Linux CentOS Server
To install easy_install on Linux using yum you will need to install the python-setuptools package. Installing this package with yum is easy by following the directions below.
Run this command in your ssh termianl bash:
yum install python-setuptools
An example of a python-setuptools install is below.
[root@server ~]# yum install python-setuptools Loading "fastestmirror" plugin Loading mirror speeds from cached hostfile * base: pubmirrors.reflected.net * updates: mirrors.serveraxis.net * addons: mirror.anl.gov * ruby: repo.premiumhelp.eu * extras: mirror.sanctuaryhost.com Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package python-setuptools.noarch 0:0.6c5-2.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: python-setuptools noarch 0.6c5-2.el5 base 479 k Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 479 k Is this ok [y/N]: y Downloading Packages: (1/1): python-setuptools- 100% |=========================| 479 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: python-setuptools ######################### [1/1] Installed: python-setuptools.noarch 0:0.6c5-2.el5 Complete!
How to Install dig on a CentOS Linux Server?
Installing dig on a CentOS Linux server is easy with yum. Dig is actually a bind tool so you will be required to install some bind libraries along with the bind utility package.
[root@server ~]# yum install bind-utils
Now you can run something like the below using dig to find MX records.
[root@server ~]# dig @NAMESERVER EXAMPLE.COM MX
Your install will look something like the below showing how yum looks for dependencies and installs them automatically.
[root@server ~]# yum install bind-utils Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for bind-utils to pack into transaction set. bind-utils-9.3.4-6.0.2.P1 100% |=========================| 40 kB 00:00 ---> Package bind-utils.x86_64 30:9.3.4-6.0.2.P1.el5_2 set to be updated --> Running transaction check --> Processing Dependency: libisccc.so.0()(64bit) for package: bind-utils --> Processing Dependency: bind-libs = 30:9.3.4-6.0.2.P1.el5_2 for package: bind-utils --> Processing Dependency: libbind9.so.0()(64bit) for package: bind-utils --> Processing Dependency: libdns.so.22()(64bit) for package: bind-utils --> Processing Dependency: libisccfg.so.1()(64bit) for package: bind-utils --> Processing Dependency: liblwres.so.9()(64bit) for package: bind-utils --> Processing Dependency: libisc.so.11()(64bit) for package: bind-utils --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for bind-libs to pack into transaction set. bind-libs-9.3.4-6.0.2.P1. 100% |=========================| 41 kB 00:01 ---> Package bind-libs.x86_64 30:9.3.4-6.0.2.P1.el5_2 set to be updated --> Running transaction check Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: bind-utils x86_64 30:9.3.4-6.0.2.P1.el5_2 updates 171 k Installing for dependencies: bind-libs x86_64 30:9.3.4-6.0.2.P1.el5_2 updates 874 k Transaction Summary ============================================================================= Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.0 M Is this ok [y/N]: y Downloading Packages: (1/2): bind-libs-9.3.4-6. 100% |=========================| 874 kB 00:35 (2/2): bind-utils-9.3.4-6 100% |=========================| 171 kB 00:04 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: bind-libs ######################### [1/2] Installing: bind-utils ######################### [2/2] Installed: bind-utils.x86_64 30:9.3.4-6.0.2.P1.el5_2 Dependency Installed: bind-libs.x86_64 30:9.3.4-6.0.2.P1.el5_2 Complete!
How to Verify a CentOS Linux Server is 32 Bit or 64 Bit?
To verify if a system is 32 bit versus 64 bit you can use the uname command. Below are examples of using the uname command from the CLI on a 32 bit system followed by using the uname command on a 64 bit system.
32 Bit CentOS Linux Server
view plaincopy to clipboardprint?
[root@server ~]# uname -a Linux server1.example.com 2.6.18-92.1.13.el5 #1 SMP Wed Sep 24 19:33:52 EDT 2008 i686 i686 i386 GNU/Linux
64 Bit CentOS Linux Server
view plaincopy to clipboardprint?
[root@server ~]# uname -a Linux server.example.com 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:35:07 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
As you can see above the 64 bit server will show x86_64 numerous times after the install date and time. The 32 bit system will show i686 and i386 after the install date and time. So it is very easy to verify if a system is 32 bit versus 64 bit using the “uname -a” command from a shell.