Ubuntu系统笔记
时间:2006-10-08 来源:thatday
shell> apt-get install ssh
shell> sudo passwd root
shell> apt-get install build-essential
shell> apt-get install gcc make autoconf automake libtool g++-2.95 flex
配置c++编译器选项,针对不同的CPU进行编译优化.[更多CPU的编译参数]
# Intel PentiumIV,Celeon Family
export CFLAGS="-march=pentium4 -mfpmath=sse -msse2 -O2 -pipe -s -fomit-frame-pointer"
# AMD Alton,Duron Family
export CFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer -msse -mmmx -m3dnow -mfpmath=sse"
apt-cache search curses | grep lib
安装libncurses5-dev
===============================================
安装mysql、apache、php环境
------------------
##### Mysql #####
./configure --prefix=/opt/mysql \
--with-mysqld-user=kevin \
--with-extra-charsets=all \
--with-unix-socket-path=/opt/mysql/var/mysql.sock
cp /opt/mysql/share/mysql/my-medium.cnf /etc/my.cnf
/opt/mysql/bin/mysql_install_db
/opt/mysql/share/mysql/mysql.server start
ps -aux | grep mysqld
chmod 755 /opt/mysql/var
chown -R kevin:kevin /opt/mysql/var
su kevin
/opt/mysql/share/mysql/mysql.server start
chown -R kevin.kevin /opt/mysql/
/opt/mysql/bin/mysqladmin -u root password 123456
------------------
##### zlib #####
zlib-1.2.3.tar.bz2 (PNG Support)
http://www.zlib.net/zlib-1.2.3.tar.bz2
tar jxf zlib-1.2.3.tar.bz2
cd zlib-2.2.3
./configure
make
make install
------------------
##### OpenSSL #####
cd openssl-0.9.7g
./config --prefix=/usr/local/ssl \
--openssldir=/usr/local/ssl \
shared \
zlib
make
make install
cd ..
------------------
##### Apache #####
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
/sbin/ldconfig
./configure --prefix=/opt/apache \
--enable-track-vars \
--enable-cgi \
--with-config-file-path=/opt/apache/conf \
--enable-modules=so \
--enable-so \
--enable-ssl \
--with-ssl=/usr/local/ssl \
--enable-rewrite=shared
--enable-mods-shared=all (可选)
------------------
##### jpegsrc.v6b.tar.gz #####
http://freshmeat.net/redir/libjpeg/5665/url_tgz/jpegsrc.v6b.tar.gz
tar zxf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure
make
mkdir -p /usr/local/man/man1
make install
make install-lib
-------------------------
##### freetype-2.2.1.tar.bz2 (TIFF Support) #####
http://sourceforge.net/project/showfiles.php?group_id=3157
tar jxf freetype-2.2.1.tar.bz2
./configure
make
make install
----------------
##### libpng-1.2.7.tar.bz2 #####
http://prdownloads.sourceforge.net/png-mng/libpng-1.2.7.tar.bz2
tar jxf libpng-1.2.7.tar.bz2
cd libpng-2.2.7
cp scripts/makefile.gcmmx makefile
make
make install
------------------
##### gd-2.0.9.tar.gz #####
http://www.boutell.com/gd/http/gd-2.0.9.tar.gz
tar zxf gd-2.0.9.tar.gz
cd gd-2.0.9
./configure
make
make install
cp gd.h /usr/local/lib/
-----------------
##### libxml2 #####
./configure
make
make install
------------------
##### ClibPDF #####
cd ClibPDF/source
cp Makefile.Linux makefile
make
make install
##### PHP #####
./configure --prefix=/opt/php \
--with-apxs2=/opt/apache/bin/apxs \
--with-gd \
--with-jpeg-dir \
--with-ttf \
--with-zlib-dir \
--with-png-dir \
--enable-magic-quotes \
--with-mysql=/opt/mysql \
--with-mysql-sock=/opt/mysql/var/mysql.sock \
--with-iconv \
--with-mbstring \
--enable-mbstring \
--enable-track-vars \
--enable-force-cgi-redirect \
--enable-ftp \
--with-config-file-path=/opt/php/etc \
--with-openssl=/usr/local/ssl \
--with-openssl-dir=/usr/local/ssl \
--with-cpdflib=/usr/local \
--with-pear=/opt/php/pear \
--with-pdo-mysql=/opt/mysql
cp php.ini-dist /opt/php/etc/php.ini
nano -w /opt/apache/conf/httpd.conf
ServerName 127.0.0.1:80
DirectoryIndex index.php
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 192.168.1.65
ServerAdmin [email protected]
ServerPath /
DocumentRoot /var/web
</VirtualHost>
ln -s /opt/mysql/lib/mysql/libmysqlclient.so.15 /usr/lib/libmysqlclient.so.15
nano -w /etc/init.d/rcS
mkdir /var/run/named &
/opt/bind/sbin/named -c /opt/bind/etc/named.conf &
cd /etc/init.d
ln -s /opt/apache/bin/apachectl apache
ln -s /opt/mysql/share/mysql/mysql.server mysql
cd /etc/rc2.d
ln -s /etc/init.d/apache S17apache
ln -s /etc/init.d/mysql S18mysql
nano -w /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/opt/mysql/bin:/opt/apache/bin"
LANG="zh_CN.GB2312"
LANGUAGE="zh_CN:zh:en_US:en"
reboot.................
over..........