![]() |
我的linux安装笔记
安装mysql (获得官方网站地址 http://dev.mysql.com/downloads/index.html)
shell> wget http://download.chyangwa.com/linux/MySQL/mysql-4.0.24.tar.gz shell> tar zxfv mysql-4.0.24.tar.gz shell> cd mysql-4.0.24 shell> groupadd mysql shell> useradd -g mysql mysql shell> ./configure --prefix=/usr/local/mysql \ --localstatedir=/usr/local/mysql/data \ --with-unix-socket-path=/tmp/mysql.sock \ --with-charset=gb2312 \ --with-mysqld-user=mysql \ --with-extra-charsets=all \ --enable-thread-safe-client \ --without-innodb shell> make && make install shell> cp support-files/my-medium.cnf /etc/my.cnf shell> cd /usr/local/mysql shell> bin/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> chgrp -R mysql . shell> bin/mysqld_safe --user=mysql & 开机自动启动 shell> vi /etc/rc.local /usr/local/mysql/share/mysql/mysql.server start ---------------------------------------------------------------------------- 输入root密码 /usr/local/mysql/bin/mysqladmin -uroot password 123456 修改root密码 /usr/local/mysql/bin/mysqladmin -uroot -p123456 password xxxxxx 登陆mysql数据库 /usr/local/mysql/bin/mysql -uroot -p , show databases; 查看数据库 线程编译方式:当前使用 ./configure --prefix=/usr/local/mysql \ --localstatedir=/usr/local/mysql/data \ --with-unix-socket-path=/tmp/mysql.sock \ --with-charset=gb2312 \ --with-extra-charsets=all \ --enable-thread-safe-client \ <----- --with-mysqld-user=mysql \ --without-innodb 进程编译方式: 默认 ./configure --prefix=/usr/local/mysql \ --localstatedir=/usr/local/mysql/data \ --with-unix-socket-path=/tmp/mysql.sock \ --with-charset=gb2312 \ --with-extra-charsets=none \ --with-mysqld-user=mysql \ --without-innodb \ --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared ---------------------------------------------------------------------------- 1、安装zlib 1.2.1(http://www.gzip.org/zlib/) shell> wget http://download.chyangwa.com/Linux/zlib/zlib-1.2.2.tar.gz shell> tar zxvf zlib-1.2.2.tar.gz shell> cd zlib-1.2.2 shell> ./configure shell> make shell> make test shell> make install 2、安装jpegsrc (http://www.optix.org/~dxy/solaris/jpegsrc/) shell> wget http://download.chyangwa.com/Linux/jpegsrc/jpegsrc.v6b.tar.gz shell> tar zxvf jpegsrc.v6b.tar.gz shell> cd jpeg-6b shell> mkdir /usr/local/man shell> mkdir /usr/local/man/man1 shell> ./configure shell> make shell> make test shell> make install shell> make install-lib 3、安装libpng libpng-1.2.5(http://www.libpng.org/pub/png/libpng.html) shell> wget http://download.chyangwa.com/Linux/libpng/libpng-1.2.8-config.tar.gz shell> tar zxvf libpng-1.2.8-config.tar.gz shell> cd libpng-1.2.8-config shell> cp scripts/makefile.linux makefile shell> vi makefile 修改其中 ZLIBLIB=/usr/local/lib ZLIBINC=/usr/local/include shell> make shell> make test shell> make install 4、安装freetype freetype-2.1.9 (http://freetype.sourceforge.net/download.html#mirror) shell> wget http://download.chyangwa.com/Linux/freetype/freetype-2.1.9.tar.gz shell> tar zxvf freetype-2.1.9.tar.gz shell> cd freetype-2.1.9 shell> make setup shell> make shell> make install 5、安装gd 2.0.33(下载地址http://www.boutell.com/gd/) shell> wget http://download.chyangwa.com/Linux/GD/gd-2.0.33.tar.gz shell> tar zxvf gd-2.0.33.tar.gz shell> cd gd-2.0.33 shell> ./configure && make && make install 6 安装apache 1.3.33 shell> wget http://download.chyangwa.com/Linux/apache/apache_1.3.33.tar.gz shell> tar zxfv apache_1.3.33.tar.gz shell> cd apache_1.3.33 shell> vi src/include/httpd.h 加大MaxClient的限制src/include/httpd.h search 256,define HARD_SERVER_LIMIT 256 edit to 2560 shell> ./configure --prefix=/usr/local/apache --enable-module=so && make && make install shell> /usr/local/apache/bin/apachectl start 7、安装php 4.3.10 shell> wget http://download.chyangwa.com/Linux/PHP/php-4.3.10.tar.gz shell> tar zxfv php-4.3.10.tar.gz shell> cd php-4.3.10 shell> ./configure --with-apxs=/usr/local/apache/bin/apxs \ --with-mysql=/usr/local/mysql \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-ttf \ --with-freetype-dir \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --enable-exif \ --enable-cli \ --enable-force-cgi-redirect \ --enable-ftp \ --enable-magic-quotes \ --enable-roxen-zts \ --enable-trace-vars shell> make shell> make install shell> cp php.ini-dist /usr/local/lib/php.ini ---------------------------------------------------------------------------- vi httpd.conf,options indexs +# DirectoryIndex + index.htm search LogLevel,edit to emerg CustomLog +# Allow,options...+# KeepAliveTimeout edit to 2 修改 httpd.conf 以支持php shell> vi /usr/local/apache/conf/httpd.conf AddType application/x-httpd-php .php shell> vi /usr/local/lib/php.ini 在页面上统计有问题。显示不出统计数值。 register_globals = On 服务器开启了自动转义, 应该关闭它. 找到: magic_quotes_gpc = On 改成:magic_quotes_gpc = Off register_globals set to on 建立 test.php <? phpinfo(); ?> ---------------------------------------------------------------------------- 8、安装ZendOptimizer 2.5.7 (http://www.zend.com/store/products/zend-optimizer.php) shell> wget http://download.chyangwa.com/Linux/Zend/ZendOptimizer-2.5.7-linux-glibc21-i386.tar.gz shell> tar zxfv ZendOptimizer-2.5.7-linux-glibc21-i386.tar.gz shell> cd ZendOptimizer-2.5.7-linux-glibc21-i386 shell> ./install.sh 然后系统开始一个安装软件的过程 回答几个问题 1 Specify the Location where to install Zend Optimizer /usr/local/Zend 2 Enter the location of your php.ini file /usr/local/lib 3 Specify the Apache bin directory /usr/local/apache/bin/httpd --------------------------------------------------- 用eAccelerator(前身Truck MMCache)加速PHP shell> wget http://download.chyangwa.com/Linux/eaccelerator/eaccelerator-0.9.2a.tar.gz shell> tar zxvf eaccelerator-0.9.2a.tar.gz shell> cd eaccelerator-0.9.2a shell> /usr/local/bin/phpize shell> /configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config && make && make install 这里最后可以得到一个很长的目录。 /usr/local/lib/php/extensions/no-debug-non-zts-20020429/ 有个 eaccelerator.so 文件,拷贝到 /usr/local/apache/ 下 shell> cp /usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so /usr/local/apache/ shell> mkdir /tmp/eaccelerator shell> chmod 777 /tmp/eaccelerator shell> vi /usr/local/lib/php.ini 加入 zend_extension="/usr/local/apache/eaccelerator.so" eaccelerator.shm_size="32" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="3600" eaccelerator.shm_only="1" eaccelerator.compress="0" eaccelerator.compress_level="0" eaccelerator.keys="shm_only" eaccelerator.sessions="shm_only" eaccelerator.content="shm_only" --------------------------------------------------- 加上批处理,开机自动启动 shell> vi /etc/rc.local /usr/local/apache/bin/apachectl start /usr/local/mysql/share/mysql/mysql.server start --------------------------------------------------- 资料来源 wget http://cn2.php.net/get/php-4.3.10.tar.gz/from/cn.php.net/mirror wget http://cn2.php.net/get/php-5.0.3.tar.gz/from/cn.php.net/mirror wget http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-standard-4.1.10-pc-linux-gnu-i686.tar.gz/from/ftp://mysql.ihostunit.com/pub/Mirror/mysql/ wget http://apache.freelamp.com/httpd/httpd-2.0.53.tar.gz wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.2a.tar.gz wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz wget http://www.zlib.net/zlib-1.2.2.tar.gz wget http://jaist.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz wget http://jaist.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gz wget http://koala.ilog.fr/ftp/pub/xpm/pixmap/pixmap2.6.tar.gz wget http://jaist.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.6.1-pl2.tar.gz ------------------------------------------------------------------------------------------ 安装apache 2.0.53 进入apache的源代码目录 (--with-mpm=prefork 就是使用多进程单线程的模块 --with-mpm=worker是多进程多线程,用第一种eaccelerator才会有优化效果。否则只能用缓存页面功能。我用的是prefork) shell> wget http://download.chyangwa.com/Linux/apache/httpd-2.0.53.tar.gz shell> tar zxfv httpd-2.0.53.tar.gz shell> cd httpd-2.0.53 shell> ./configure --prefix=/usr/local/apache2 --with-mpm=prefork --enable-so shell> make shell> make install shell> /usr/local/apache2/bin/apachectl start 安装php 4.3.10 shell> wget http://download.chyangwa.com/Linux/PHP/php-4.3.10.tar.gz shell> tar zxfv php-4.3.10.tar.gz shell> cd php-4.3.10 shell> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-ttf \ --with-freetype-dir \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --enable-exif \ --enable-cli \ --enable-force-cgi-redirect \ --enable-ftp \ --enable-magic-quotes \ --enable-roxen-zts \ --enable-trace-vars shell> make shell> make install shell> cp php.ini-dist /usr/local/lib/php.ini vi /usr/local/apache2/conf/httpd.conf 在AddType application/x-tar.tgz下面,添加以下内容: AddType application/x-httpd-php .php shell> vi /etc/rc.local /usr/local/apache2/bin/apachectl start /usr/local/mysql/share/mysql/mysql.server start ------------------------------------------------------------------------------------------ 编译resin让web支持jsp文件: 1、软件 j2sdk-1_3_1_06-linux-i586.rpm.bin resin-ee-2.1.10.tar.gz 下载连接: http://java.sun.com/webapps/download/DisplayLinks http://www.caucho.com/download/index.xtp 2、安装jdk: # cd /usr/local # cp j2sdk-1_3_1_06-linux-i586.rpm.bin /usr/local # cp resin-ee-2.1.10.tar.gz /usr/local # ./j2sdk-1_3_1_06-linux-i586.rpm.bin --生成rpm文件,其中有提问,回答yes。 # rpm -ivh j2sdk-1_3_1_06-linux-i586.rpm # ln -s /usr/java/jdk1.3.1_06 /usr/local/jdk # ln -s /usr/local/jdk /usr/local/jre 3、安装resin: # cd /usr/local/ # tar zxvf resin-ee-2.1.10.tar.gz # cd resin-ee-2.1.10 # ./configure --with-apxs=/var/www/bin/apxs # make # make install # cd conf # vi resin.conf <http-server> <!-- - The root file directory of the server. Apache users will change - this to /usr/local/apache/htdocs and IIS users will change it - to d:\inetpub\wwwroot --> <app-dir>/var/www/htdocs/</app-dir> --默认是doc,更改成你的apache的主页发布目录。 <!-- the http port --> <http port='8080'/> <!-- - The srun port, read by both JVM and plugin - 127.0.0.1 is the localhost --> <srun host='127.0.0.1' port='6802'/> <!-- 4、修改环境变量: # vi /etc/profile 添加: PATH=$PATH:/usr/local/jdk/bin:/usr/local/jre/bin export PATH JAVA_HOME=/usr/local/jdk export JAVA_HOME CLASSPATH=/usr/local/jdk/lib:/usr/local/jre/lib:/usr/local/resin-ee-2.1.10/lib export CLASSPATH 5、测试: # vi /var/www/htdocs/index.jsp 编辑: <%@page language="java"%> 2+2=<%=2+2%> # vi /var/www/conf/httpd.conf DirectoryIndex index.jsp index.html index.php --添加index.jsp # /var/www/bin/apachectl start # /usr/local/resin-ee-2.1.10/bin/httpd.sh 浏览http://yourdomain ,看见2+2=4,就ok了 具体还有很多东西要做,但是初步的安装就已经完成了。 好了,到这里,安装工作做完了,剩下的,就是配置了 |
| 所有的时间均为北京时间。 现在的时间是 23:42. |
NewvBB Core 1.1 Final - vBulletin v3.0.3
中文化与插件制作 NewVBB.com™ 2026。