Nov 7, 2011

Installing and Configuring Apache PHP and MySQL on ArchLinux





Installing and Configuring Apache PHP and MySQL on ArchLinux


A server is an indispensable tool for any web developer, even if someone does not want to try a software developer as wordpress or joomla need to install a local server to do so.
Archlinux gives us the opportunity to have one very easily.
The first thing to do is install tenermos binaries MySQL, PHP and Apache and then configure the environment:
# Pacman-S apache php mysql php-apache
We add our user to the http:
# Gpasswd-a http Pahko
where "Pahko" is the name of its user.
Edit the file / etc / hosts and add the following line (probably already have, if not be sure it is well):
# 127.0.0.1 localhost.localdomain localhost
Then you can access your server via http://localhost/, if you want to have another name being followed can put like this:
# 127.0.0.1 localhost.localdomain localhost Maebe
So you can also access your server via http://maebo/, you should just make sure the name you are giving to the server is the same as they have in / etc / rc.conf on the line HOSTNAME = "Maebe" .
Apache configuration:
Edit the file / etc / httpd / conf / httpd.conf and comment or rather we put a "#" in the following line:
Unique_id_module LoadModule modules / mod_unique_id.so
being as follows:
# LoadModule unique_id_module modules / mod_unique_id.so
Reboot the server:
# / Etc / rc.d / httpd restart
Now you can see the server running on http://localhost/ or in my case also http://maebo/.
We added the devil in our / etc / rc.conf:
DAEMONS = ( ... @ httpd )
Create the directory "public_html" folder on our staff is, in my case / home / Pahko / running / home / Pahko / public_html / and give permissions:
$ Chmod o + x ~ / public_html
Now we have the server with folders for each user accessing the server through http://localhost/ ~ user as mine would be: http://localhost/ ~ Pahko /
Configuring PHP:
Edit the file / etc / httpd / conf / httpd.conf and add the following line:
LoadModule php5_module modules / libphp5.so
right after:
Dir_module LoadModule modules / mod_dir.so
Add just after:
Various default settings # 
Include conf
/ extra / httpd-default.conf
this:
Php configuration # 
Include conf
/ extra / php5_module.conf
Edit the file / etc / php / php.ini and and de-comment the following line:
; extension = gd.so
look like this:
extension = gd.so
the same with:
; extension = mcrypt.so
to:
 extension = mcrypt.so
also change the mode to debug:
display_errors = Off
being:
display_errors = On
and
change this:
; Date.timezone =
by:
; Date.timezone = America / Mexico_City
reboot the server:
# / Etc / rc.d / httpd restart
php and configured.
Apache Configuration:
Edit the file / etc / php / php.ini and mysql support enabled:
; extension = mysql.so
to:
extension = mysql.so
We start the mysql server:
# / Etc / rc.d / mysqld start
Assign a root password to manage mysql:
mysqladmin -u root password password
We added to our rc.conf daemon:
 DAEMONS = ( ... mysqld ... )
With that we have running our local server! 

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Premium Wordpress Themes