Category Archives: apache

How to Build a WebServer on CentOS 6.4

You must Install Centos on your Server and I am here Using Centos 6.4.

Some we Need For Build a WebServer on CentOS 6.4 :

Apache
PHP5
MYSQL
PhpMyAdmin

Lets Install all it.

APACHE

yum install httpd

and now configure apache in the startup

chkconfig --levels 235 httpd on

and start it

service httpd start

Test it in your Browser http://192.168.1.20/

PHP5

yum install php

and restart your apache

service httpd restart

and test the php by create the file “info.php”

cd /var/www/html/

nano info.php

put this code :

<? phpinfo (); ?>

and open your browser http://192.168.1.20/info.php

and you get all information about your system.

MYSQL

yum install mysql mysql-server

and configure in startup

chkconfig --levels 235 mysqld on

and now start it

service mysqld start

next Configure the root password for mysql :

mysql_secure_installation

pres ENTER – ENTER – ENTER and

if you see the word ” Set root password ? Y/N ” you must enter your password there and renter it. And just press ENTER to finish it.

Now is Getting MYSQL connect and support for PHP5.

yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc

and restart your Apache

service httpd restart

now check it from yor browser http://192.168.1.20/info.php

and you get mysql there and other module.

PhpMyAdmin

Default Centos Repository is does not provide for phpmyadmin package.And we must install from other repositories.

for 32bit.

yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

for 64bit.

yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

now time to install :

yum -y install phpmyadmin

configure phpmyadmin to be easy to access.

nano /etc/httpd/conf.d/phpmyadmin.conf

and comment the code like this :

#
# Web application to manage MySQL
#

#<Directory "/usr/share/phpmyadmin">
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

next is changet the authentication from “cookie” to “http” :

nano /usr/share/phpmyadmin/confic.inc.php

ctrl + w and type “cookie” ENTER. And Replace with “http

[...]
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
[...]

now restart apache

service httpd restart

and test for phpmyadmin http://192.168.1.20/phpmyadmin/

and congratulations you have successfully built webserver on CentOS 6.4 – Thankz @howtoforge

The post How to Build a WebServer on CentOS 6.4 appeared first on ndesocode.

Mengatasi Httpd/ Apache Hang Pada Server anda

webserver
Anda yang menggunakan VPS (unmanaged) untuk hosting web anda sendiri tentu harus mengatasi sendiri jika ada masalah. Sebagai contoh adalah ketika web Anda jadi lambat diakses atau RTO.

Hal ini bisa disebabkan karena apache Anda ngehang. Anda bisa cek hal ini dengan login ke whm, lalu di “apache status” akan tertera tulisan warna merah yang artinya apache Anda tidak jalan.

Ikuti langkah berikut :

1. Login ke SSH via putty

2. Ketik :

grep -i maxclient /usr/local/apache/logs/error_log

atau

tail -f /var/log/httpd/error_log

Jika muncul seperti ini :

[Fri Aug 02 06:59:37 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting

itu artinya server anda sudah mencapai setting MaxClients, sehingga Anda harus menaikkan MaxClients dan ServerLimit di global setting apache

3. Di WHM, klik Apache Configuration > Global Configuration. Pada MaxClients dan ServerLimit ubah menjadi : 512

4. Klik tombol “Save“, lalu klik tombol “Rebuild Configuration and Restart Apache

 

Tips : Agar Anda bisa langsung mendapat notifikasi via email jika http request error, sebaiknya Anda daftarkan domain Anda di uptimerobot.com (gratis).

How to enable mod_rewrite in Apache

Salam all ..

tonight just share the article about mod_rewrite in Apache.
this is very usefull for us.

This module is make the URL look beutifull.
lets do it*

So Now Install your Apache :

sudo apt-get install apache2

then enable mod_rewrite

a2enmod rewrite

Oke lets Setting up mod_rewrite :

Search the file ” mod_rewrite.so ” , type in terminal :

locate mod_rewrite.so

and you get the location ” /usr/lib/apache2/modules

So now go to apache directory :

cd /etc/apache2/sites-enabled/
nano rewrite.load

paste this code :

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Oke.
finish in this directory and go to other.

cd /etc/apache2/sites-available/
nano 000-default

go to this line :

Options Indexes FollowSymLinks MultiViews

and change this :

AllowOverride None

to

AllowOverride all
Save and Exit .
Now Restart your apache.
/etc/init.d/apache2 restart
Thnkz.

The post How to enable mod_rewrite in Apache appeared first on ndesocode.