PHP, Apache, and Mysql HOWTO


ZENCAFE : PHP, Apache, and Mysql HOWTO

PHP (5.1.2 at the time of writing)

First open up a terminal then login as root.

Code:

 

username[~]$ su
Password:
root[username]#

Then use netpkg to download the latest version of PHP on the repository and install it.

Code:

 

root[username]# netpkg php
Checking for network connectivity, please wait...
Downloading dependency file
ddependencies : yes
Connecting to the packages repository...

[N][s] Found php-5.1.2-i486-2z22.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip

PHP is now installed.

Apache (2.2.0 at the time of writing)

Again we are going to use netpkg for installation.
Open a terminal and login as root if you are not root already.

Install Apache with netpkg.

Code:

 

root[username]# netpkg apache
Checking for network connectivity, please wait...
Downloading dependency file
ddependencies : yes
Connecting to the packages repository...

[N][s] Found apache2-2.2.0-i486-3z22.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip

First we need to make the apache startup script executable

As root:

Code:

 

chmod +x /etc/rc.d/rc.httpd

1) If you want apache to be able to use PHP edit /etc/apache/httpd.conf as root.
Change the the line at the very bottom of /etc/apache/httpd.conf that says:

Code:

 

# PHP support
#Include /etc/apache/mod_php.conf

to:

Code:

 

# PHP support
Include /etc/apache/mod_php.conf

Add index.php as a DirectoryIndex.

Code:

 

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

Now it should be

Code:

 

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

Now save the modifications to /etc/apache/httpd.conf.

Start the Apache webserver

As root:

Code:

 

/etc/rc.d/rc.httpd start

Note: Any changes you make to /etc/apache/httpd.conf while the apache server is running, the changes will not take affect until the apache server has been restarted.

Mysql (5.0.19 at the time of writing)

Install mysql with netpkg

As root:

Code:

 

root[username]# netpkg mysql
Checking for network connectivity, please wait...
Downloading dependency file
dependencies : yes
Connecting to the packages repository...

[N][s] Found mysql-5.0.19-i486-1z24.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip

In the terminal (as root):

Code:

 

root[username]#su - mysql
/dev/pts/0: Operation not permitted
mysql[~]$

Now install the database

Code:

 

mysql_install_db

exit from the prompt

Code:

 

mysql[~]$ exit
logout
root[username]#

As root (after typing exit you should be root). We are going to make the mysql script executable.

Code:

 

chmod +x /etc/rc.d/rc.mysqld

Start the mysql server

Code:

 

root[username]# /etc/rc.d/rc.mysqld start

You should see this:

Code:

 

root[username]# Starting mysqld daemon with databases from /var/lib/mysql

the terminal will stay like this. You can get a prompt back by typing CTRL-C.
Note: The mysql server will not stop. It is still running.

Now create a root password for mysql:

Code:

 

mysqladmin -u root password 'new-password'

An example of the root password for mysql:

Code:

 

root[username]# mysqladmin -u root password zenwalk

PHP, Apache, and Mysql should be installed and working properly with each other.

9 comments

  1. cevarief · ·

    Mau tanya nih, kalo MySQLnya dirun sebagai service, kok default port 3306nya gak bisa kebuka ya sehingga aplikasi lain gak bisa konek (padahal masih di PC yang sama), misal dari Netbeans atau iReport. Saya sudah tambahin port 3306 TCP di etc/service, tetep tidak kebuka. Tapi kalau dirun manual dengan user bukan root bisa. Can help ? Saya pake Zenwalk 5.0.

    Thanks sebelumnya.

    bayu :

    cek di /etc/my.cnf
    pilih konfigurasi yang sesuai dengan kebutuhan anda
    apakah mysql akan listen di sock or port

  2. Is it convenient to talk at the moment? tiny child teens 448

  3. What do you want to do when you’ve finished? youngest girl pictures 951293

  4. Where are you calling from? japanese preteen lesbian dnnav

  5. Can I take your number? cp company presents
    iooy

  6. I’m doing an internship http://eucidoina.blog.free.fr/ young preteen feet ok she’s horny of course, the cream is part of her juices but also because a woman’s hormonal cycle changes, it creates a thicker coating of discharge/wetness so sometimes you can see it more when having sex.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: