Beruflich Dokumente
Kultur Dokumente
I do not issue any guarantee that this will work for you!
1 Preliminary Note
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in
as root:
sudo su
2 Installing MySQL 5
You will be asked to provide a password for the MySQL root user - this password is valid
for the user root@localhost as well as root@server1.example.com, so we don't have to
specify a MySQL root password manually later on:
3 Installing Cherokee
Now direct your browser to http://192.168.0.100, and you should see the Cherokee
placeholder page:
Cherokee can be configured through a web-based control panel which we can start as
follows:
cherokee-admin -b
(By default cherokee-admin binds only to 127.0.0.1 (localhost), which means you can
only connect to it from the same system. With the -b parameter you can specify the
network address to listen to. If no IP is provided, it will bind to all interfaces.)
root@server1:~# cherokee-admin -b
Login:
User: admin
One-time Password: 0VNcEcyFrLS7gLW4
Web Interface:
URL: http://localhost:9090/
Cherokee Web Server 0.99.19 (Aug 29 2009): Listening on port ALL:9090,
TLS
disabled, IPv6 disabled, using epoll, 1024 fds system limit, max. 505
connections, caching I/O, single thread
You need the username and password to log into the web interface which can be found on
http://192.168.0.100:9090/:
4 Installing PHP5
We can make PHP5 work in Cherokee through FastCGI. Fortunately, Ubuntu provides a
FastCGI-enabled PHP5 package which we install like this:
5 Configuring PHP5
We must modify /etc/php5/cgi/php.ini and add the line cgi.fix_pathinfo = 1 right at the
end of the file:
vi /etc/php5/cgi/php.ini
[...]
cgi.fix_pathinfo = 1
PHP is not enabled in Cherokee by default. To enable it, we need to start Cherokee's
web-based control panel...
cherokee-admin -b
Now go to Virtual Servers, pick the default vhost and go to the Behavior tab:
The document root of the default web site is /var/www. We will now create a small PHP
file (info.php) in that directory and call it in a browser. The file will display lots of useful
details about our PHP installation, such as the installed PHP version.
vi /var/www/info.php
<?php
phpinfo();
?>
As you see, PHP5 is working, and it's working through FastCGI, as shown in the Server
API line. If you scroll further down, you will see all modules that are already enabled in
PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5
yet.
8 Getting MySQL Support In PHP5
To get MySQL support in PHP, we can install the php5-mysql package. It's a good idea
to install some other PHP5 modules as well as you might need them for your
applications. You can search for available PHP5 modules like this:
Pick the ones you need and install them like this:
/etc/init.d/cherokee restart
Cherokee: http://www.cherokee-project.com/
PHP: http://www.php.net/
MySQL: http://www.mysql.com/
Ubuntu: http://www.ubuntu.com/