Openbsd 3.6 + APACHE + MYSQL + PHP + mod_limitipconn(轉)
llzqq < llzqq@126.com >
歡迎大家轉貼這個文章,但要保留下面的版權資訊:
本文旨在用OPENBSD自己提供的安裝包來搭建伺服器環境,當然你也可以下載原始碼包編譯安裝,但這樣OPENBSD的安全就不容易保證了。因為各個包之間有依賴性關係所以下面列出了本文中用到的所有安裝包大家把下面的所有包複製到一個目錄中安裝就很順利了:
freetype-1.3.1p1.tgz
jpeg-6b.tgz
php4-core-4.3.8.tgz
php4-gd-4.3.8-no_x11.tg
png-1.2.5p5.tgz
recode-3.6p1.tgz
t1lib-5.0.0.tgz
tiff-3.6.1p1.tgz
mysql-client-4.0.20.tgz
mysql-server-4.0.20.tgz
p5-DBD-mysql-2.9004.tgz
p5-DBI-1.43.tgz
p5-Net-Daemon-0.38.tgz
p5-PlRPC-0.2018.tgz
p5-PlRPC-0.2018.tgz.1
mod_limitipconn-0.04.tar.gz
下載地址:
配置APACHE伺服器
因為APACHE是系統預設安裝的,這裡就省去了安裝過程
下面配置APACHE以便可以開機執行
# vi /etc/rc.conf
改: httpd_flags=NO
為: httpd_flags=""
對apache做一初步設定
# vi /var/www/conf/httpd.confServerAdmin llzqq@126.comServerName nero.3322.orgServerTokens ProdServerSignature EMail
安裝mysql-server-4.0.20
# pkg_add mysql-server-4.0.20.tgz # cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
如果不想讓其他機器連線MYSQL,可以透過下面的操作實現: # vi /etc/my.cnf bind-address = 127.0.0.1
啟動MYSQL-SERVER伺服器: # /usr/local/bin/mysqld_safe &
設定ROOT的MYSQL密碼: # /usr/local/bin/mysqladmin -u root password your_password
為了方便啟動和關閉MYSQL服務建立了下面的指令碼: # vi /etc/rc.d/mysqld.sh ======================================================== #!/usr/local/bin/bash # made by llzqq # 02/08/ 2004 # mysql startup scriptscase "$1" instart)if [ -x /usr/local/bin/mysqld_safe ]; then/usr/local/bin/mysqld_safe &fi;;stop)pkill mysqld &rm -f /var/run/mysql/mysql.sock &;;*)echo "$0 start | stop";;esacexit 0========================================================# chmod 555 /etc/rc.d/mysqld.sh
設定開機啟動MYSQL
# vi /etc/rc.localif [ -f /etc/my.cnf ]; then. /etc/rc.d/mysqld.sh startfi
安裝配置PHP-4.3.8
# pkg_add php4-gd-4.3.8-no_x11.tgz
執行下面的命令使其生效
# 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
由於OPENBSD上面的APACHE採用了CHROOT機制,要保證PHP正常工作就要建下面的目錄作為PHP的工作目錄:
# mkdir /var/www/tmp # chmod 1777 /var/www/tmp
# pkg_add php4-mysql-4.3.8.tgz
執行下面的命令使其生效 # /usr/local/sbin/phpxs -a mysql
# pkg_add php4-ncurses-4.3.8.tgz
執行下面的命令使其生效 # /usr/local/sbin/phpxs -a ncurses
# pkg_add php4-imap-4.3.8.tgz
執行下面的命令使其生效 # /usr/local/sbin/phpxs -a imap
# vi /var/www/conf/httpd.confDirectoryIndex index.html index.phpAddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps# vi /var/www/conf/php.inidoc_root= "/htdocs"register_globals = On
建立測試php頁面
# vi /var/www/htdocs/test.php?php>
測試一下:
# pkill httpd# /usr/sbin/httpd
在瀏覽器中輸入實驗一下
安裝mod_limitipconn模組來限制單IP的併發連線數
# tar xzf mod_limitipconn-0.04.tar.gz # cd mod_limitipconn-0.04 # vi Makefile APXS = /usr/sbin/apxs# make# make install# vi /var/www/conf/httpd.conf MaxConnPerIP 3
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752019/viewspace-941824/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- OpenBSD WEB基本應用Apache + php4 + mysql + ftp + tomcat(轉)WebApachePHPMySqlFTPTomcat
- Linux安裝:mysql+apache+php(轉)LinuxMySqlApachePHP
- 最佳化安裝 mysql+apache+php(轉)MySqlApachePHP
- ssl + apache? 我的是RH7.2(3) ,APACHE,PHP和MYSQL(轉)ApachePHPMySql
- OpenBSD安裝(轉)
- apache+mysql4+phpApacheMySqlPHP
- 在Debian上配置Apache+MySQL+PHP4(轉)ApacheMySqlPHP
- linux+mysql+apache+phpLinuxMySqlApachePHP
- Apache、SSL、MySQL和PHP平滑無縫地安裝 (轉)ApacheMySqlPHP
- FreeBSD下安裝Apache+PHP+MySQL+Tomcat(轉)ApachePHPMySqlTomcat
- Redhat9.0 Apache2+Php5.0+Mysql4.0配置(轉)RedhatApachePHPMySql
- nginx+LAMP(apache+php+mysql)NginxLAMPApachePHPMySql
- apache、php、mysql安裝過程ApachePHPMySql
- aliyun install php apache mysql nginxPHPApacheMySqlNginx
- Apache、php、mysql(最新安裝版)ApachePHPMySql
- mysql和apache不認識phpMySqlApachePHP
- 用ports安硯apache13_modssl+mysql+php+phpmyadmin(轉)ApacheMySqlPHP
- FreeBSD下安裝MySQL+Apache+PHP新手指南(轉)MySqlApachePHP
- 無廢話 apache+mysql+php+snmp+rrdtool+cacti 配置(轉貼)ApacheMySqlPHP
- Zope的優點和Apache+PHP+MySQL的比較(轉)ApachePHPMySql
- debian + apache2 + php4 +mysql +phpmyadmin + mt(轉)ApachePHPMySql
- 在RedHat Linux 7.3下安裝Apache + PHP + Mysql + JDK + Resin (轉)RedhatLinuxApachePHPMySqlJDK
- 紅旗5.0下apache+php+mysql+phpMyAdmin全攻略(轉)ApachePHPMySql
- OpenBSD――另類安裝法(轉)
- Windows下安裝 Apache PHP Mysql RedisWindowsApachePHPMySqlRedis
- ubuntu安裝php+mysql+apache2UbuntuPHPMySqlApache
- 安裝 Apache2+PHP5+MySQLApachePHPMySql
- linux解除安裝mysql,apache,phpLinuxMySqlApachePHP
- Linux+Apache+Mysql+PHP典型配置LinuxApacheMySqlPHP
- SUSE 下安裝php+apache+mysqlPHPApacheMySql
- LAMP全新安裝 Linux+Apache+MySQL+PHP+phpLAMPLinuxApacheMySqlPHP
- Apache+SSL+PHP+JSP+MySQL+IMAP+GD安裝全攻略(轉)ApachePHPJSMySql
- PHP4 + MYSQL + APACHE 在 WIN 系統下的安裝、配置 (轉)PHPMySqlApache
- Linux配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD庫(轉)LinuxApachePHPMySql
- linux下配置APACHE2.0.50+PHP5.0.3+MYSQL4.0.20+GD庫(轉)LinuxApachePHPMySql
- Linux搭建PHP+MySQL+Apache環境LinuxPHPMySqlApache
- Centeros 6 安裝 php7 apache mysqlROSPHPApacheMySql
- Windows+Apache+PHP+MySQL+PHPMyadmin的配置WindowsApachePHPMySql