日期:2011-06-18 22:50:00 来源:本站整理
Ubuntu 11.04服务器安装全历程文字版[服务器安全]
本文“Ubuntu 11.04服务器安装全历程文字版[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
1.安装Ubuntu 11.04 Server 64位.
2.安装ssh服务
sudo apt-get install openssh-server
生成密钥
ssh-keygen
将公钥改名留在服务器上
mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
将私钥 id_rsa 从服务器上复制出来,并删撤除服务器上的 id_rsa 文件
scp ~/.ssh/id_rsa wangbin@192.168.0.XXX:/home/XXX/.ssh/id_rsa_local_101
rm ~/.ssh/id_rsa -f
3.设置静态ip地址:
vim /etc/network/interfaces
假如配置动态获得ip,则在上述文件中加入以下内容:
auto eth0
iface eth0 inet dhcp
假如配置静态ip,则增添以下内容:
auto eth0
iface eth0 inet static
address 192.168.33.201
netmask 255.255.255.0
gateway 192.168.33.1
如果配置见效,需求重启网卡:
ifconfig eth0 down
ifconfig eth0 up
若还有没有配置成功,则需重启下网络服务
/etc/init.d/networking restart
配置dns
vim /etc/resolv.conf
nameserver 202.112.125.53
改正计算机名
sudo vim /etc/hostname
sudo reboot
4.优化Ubuntu系统
改正语言,办理乱码问题
vim /etc/default/locale
LANG="zh_CN.UTF-8"
5.拷贝所需软件
将以下软件 mysql-5.1.53.tar.gz, php-5.3.3.tar.gz, eaccelerator-0.9.6-rc2.tar.bz2, nginx 拷贝到~/tmp/目录下
6.安装mysql
sudo groupadd mysql
sudo useradd -g mysql mysql
cd ~/tmp/
tar -zxvf mysql-5.1.53.tar.gz
cd mysql-5.1.53/
sudo apt-get install g++ gcc make automake perl
sudo apt-get install libncurses5-dev
./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
make
sudo make install
sudo mkdir /usr/local/webserver/mysql/data
sudo chown -R mysql:mysql /usr/local/webserver/mysql/data
sudo /usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data --user=mysql
/usr/local/webserver/mysql/bin/mysqld_safe &
/usr/local/webserver/mysql/bin/mysqladmin -uroot password 'XXX'
sudo mkdir /usr/local/webserver/mysql/conf
sudo cp ~/tmp/mysql-5.1.53/support-files/my-small.cnf /usr/local/webserver/mysql/conf/my.cnf
/usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/usr/local/webserver/mysql/conf/my.cnf 2>&1 > /dev/null &7.安装php
cd ~/tmp/
tar -zxvf php-5.3.3.tar.gz
cd php-5.3.3/
sudo apt-get install libevent-dev
sudo apt-get install libxml2-dev
sudo apt-get install curl
sudo apt-get install libssl-dev
sudo apt-get install libcurl3
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62-dev
sudo cp /usr/lib/x86_64-linux-gnu/libjpeg.* /usr/lib/
sudo cp /usr/lib/x86_64-linux-gnu/libpng* /usr/lib/
sudo apt-get install libfreetype6-dev
ubuntu下无法利用无线网络的办理办法
三步搞定windows与ubuntu之间文件同享
Ubuntu和windows文件同享问题详解
在 Ubuntu 12.04 Server 上安装 Rails 环境
ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解
Linux(ubuntu)下配置android环境
Ubuntu 10.04上搭建Ruby on Rails环境
Ubuntu 10.10中关闭按钮位置的改变
Ubuntu下检测CPU温度的工具
Ubuntu Server增添关机用户
Ubuntu 11.04安装火狐5
ubuntu 10.04下搭建samba文件服务器
sudo apt-get install libmcrypt-dev
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir= --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-exif --enable-soap --without-pear --enable-fpm
make
sudo make install
sudo cp ~/tmp/php-5.3.3/php.ini-production /usr/local/webserver/php/etc/php.ini
sudo mv /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
sudo groupadd www
sudo useradd -g www www
sudo mkdir -p /www/webroot
sudo chmod +w /www/webroot
sudo chmod -R www:www /www/webroot
sudo chown -R www:www /www/webroot
#安装php扩大eaccelerator
cd ~/tmp/
tar -jxvf eaccelerator-0.9.6-rc2.tar.bz2
cd eaccelerator-0.9.6-rc2/
/usr/local/webserver/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config
make
sudo make install
#sudo vim /etc/sysctl.conf
#安装php扩大memcache
cd ~/tmp/
tar -zxvf memcache-2.2.6.tgz
cd memcache-2.2.6/
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
sudo make install
8.安装nginx
cd ~/tmp/
tar -zxvf nginx-0.8.53.tar.gz
cd nginx-0.8.53/
sudo apt-get install libpcre3-dev
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
make
sudo make install
sudo mkdir -p /www/logs
sudo chmod +w /www/logs
sudo chown -R www:www /www/logs
9.开机自启动配置
#直接更改rc.local
sudo vim /etc/init.d/rc.local
/usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/usr/local/webserver/mysql/conf/my.cnf 2>&1 >/tmp/logs/mysql_sart.log &
/usr/local/webserver/php/sbin/php-fpm 2>&1 >/tmp/logs/php_start.log
/usr/local/webserver/nginx/sbin/nginx 2>&1 >/tmp/logs/nginx_start.log
#通过update-rc.d设置
sudo cp ~/tmp/mysql-5.1.53/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
sudo chmod +x /etc/init.d/mysql
update-rc.d -f mysql defaults
sudo update-rc.d -f mysql defaults
以上是“Ubuntu 11.04服务器安装全历程文字版[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:本文地址: | 与您的QQ/BBS好友分享! |
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论