apache | mysql Author: llzqq [article from: http://www.cnfug.org]
Openbsd 3.6 + APACHE + MYSQL + PHP + mod_limitipconn
llzqq <llzqq@126.com>
Everyone is welcome to repost this article, but keep the following copyright information:
This article aims to use the installation package provided by OPENBSD to build a server environment. Of course, you can also download the original code package to compile and install, but the security of OPENBSD is not easy to guarantee. Because there are dependencies between the packages, all the installation packages used in this article are listed below. You can copy all the packages below to a directory and install it smoothly:
If you don't want other machines to connect to MYSQL, you can use the following operations:
# vi /etc/my.cnf
bind-address = 127.0.0.1
Start the MYSQL-SERVER server:
# / usr / local / bin / mysqld_safe &
Set the MySQL password for ROOT:
# / usr / local / bin / mysqladmin -u root password your_password
To facilitate starting and stopping the MYSQL service, the following script is created:
# vi /etc/rc.d/mysqld.sh
======================================================== ======
#! / usr / local / bin / bash
# made by llzqq
# 02/08/2004
# mysql startup scripts
# chmod 555 /etc/rc.d/mysqld.sh
Set up startup MYSQL
# vi /etc/rc.local
if [-f /etc/my.cnf]; then
. /etc/rc.d/mysqld.sh start
fi
Install and configure PHP-4.3.8
# pkg_add php4-gd-4.3.8-no_x11.tgz
Run the following command to make it take effect
# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
# / usr / local / sbin / phpxs -s
# / usr / local / sbin / phpxs -a gd
Since APACHE on OPENBSD uses the CHROOT mechanism, to ensure that PHP works properly, the following directory must be created as the working directory for PHP:
# mkdir / var / www / tmp
# chmod 1777 / var / www / tmp
# pkg_add php4-mysql-4.3.8.tgz
Run the following command to make it take effect
# / usr / local / sbin / phpxs -a mysql
# pkg_add php4-ncurses-4.3.8.tgz
Run the following command to make it take effect
# / usr / local / sbin / phpxs -a ncurses
# pkg_add php4-imap-4.3.8.tgz
Run the following command to make it take effect
# / usr / local / sbin / phpxs -a imap
# vi /var/www/conf/httpd.conf
DirectoryIndex index.html index.php
AddType application / x-httpd-php .php
AddType application / x-httpd-php-source .phps
# vi /var/www/conf/php.ini
doc_root = "/ htdocs"
register_globals = On
Build test php page
# vi /var/www/htdocs/test.php
<? php phpinfo ();?>
have a test:
# pkill httpd
# / usr / sbin / httpd
Enter http: //IP/test.php in your browser to experiment
Install the mod_limitipconn module to limit the number of concurrent connections for a single IP
# tar xzf mod_limitipconn-0.04.tar.gz
# cd mod_limitipconn-0.04
# vi Makefile
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.