1.安装 rz/sz和SSH:
sudo apt-get install lrzsz
sudo apt-get install openssh-server
2.lucid(10.04)的源添加如下:
sudo vi /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main
deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main
deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main
最后一行为nginx的ppa源,需要添加key,在终端运行:
sudo apt-key adv --keyserver keyserver.Ubuntu.com --recv-keys C300EE8C
更新
sudo apt-get update
3.安装网站系统
sudo apt-get install nginx php5-common php5-dev php5-cgi php5-fpm php-apc php5-mysql php5-curl php5-gd php5-idn php-pear php5-mcrypt php5-memcache php5-ming php5-recode php5-tidy php5-xmlrpc php5-xsl mysql-server
上面为必选安装,以下php组件为可选安装,一般网站程序可能用不着:
sudo apt-get install php5-imagick php5-imap php5-recode php5-snmp php5-sqlite php5-xmlrpc php5-suhosin php5-odbc php5-ladp
4.修改nginx配置
sudo vi /etc/nginx/sites-enabled/default
把其中的:
root /usr/share/nginx/www;
index index.html index.htm;
改为:
root /usr/share/nginx/www;
index index.php index.html index.htm;
其中的:
#location ~ \.php$ {
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi_params;
#}
改为:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www$fastcgi_script_name;
include fastcgi_params;
}
更改网站目录权属:
sudo chown -R yourusername /usr/share/nginx/www/
5.安装ZendGuardLoader及eaccelerator:
修改php版本号,以避免因为从源安装版本号不一致,导致eaccelerator启动报错:
sudo vi /usr/include/php5/main/php_version.h
将
#define PHP_VERSION “5.3.2-1ubuntu4.7″
修改为
#define PHP_VERSION “5.3.2-1ubuntu4.7ppa5~lucid1″
sudo mkdir /usr/zend
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
cd /tmp
wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
sudo mv ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so /usr/zend/ZendGuardLoader.so
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar xvjf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
cp control.php /usr/share/nginx/www/control.php //复制控制程序到网站目录,通过http://网站名/control.php访问,默认帐号为admin,密码为eAccelertor,可编辑此文件修改。
phpize
sudo ./configure --enable-eaccelerator=shared
sudo make
sudo make install
sudo vi /etc/php5/fpm/php.ini
在配置文件最后加上:
zend_extension=/usr/zend/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
zend_extension="/usr/lib/php5/20090626/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path="/usr/share/nginx/www/control.php"
6.(可选步骤)安装phpmyadmin:
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.0/phpMyAdmin-3.4.0-all-languages.tar.bz2
tar xvjf phpMyAdmin-3.4.0-all-languages.tar.bz2
mv phpMyAdmin-3.4.0-all-languages /usr/share/nginx/www/phpmyadmin
cd /usr/share/nginx/www/phpmyadmin
cp config.sample.inc.php config.inc.php
vi config.inc.php
将其中的:
$cfg['blowfish_secret'] = '';
改为:
$cfg['blowfish_secret'] = 'web';
将其中的:
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
改为:
$cfg['Servers'][$i]['controluser'] = '你的mysql用户名';
$cfg['Servers'][$i]['controlpass'] = '你的mysql用户密码';
将
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
的// 全去掉
将phpmyadmin/scripts目录中的creat_tables.sql文件导入mysql
7.安装Wordpress
在mysql数据库中创建属于自己的WordPress用户名和数据库。
cd /tmp
wget http://cn.wordpress.org/wordpress-3.1.2-zh_CN.tar.gz
tar zxvf wordpress-3.1.2-zh_CN.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
sudo vi wordpress/wp-config.php
在标有
// ** MySQL settings - You can get this info from your web host ** //
下输入你的数据库相关信息
DB_NAME
为WordPress创建的数据库名称
DB_USER
创建的WordPress用户名
DB_PASSWORD
为WordPress用户名设定的密码
DB_HOST
设定的hostname(通常是localhost,但总有例外;参见编辑wp-config.php文件中的“可能的DB_HOST值)。
DB_CHARSET
数据库字符串,通常不可更改(参见zh-cn:编辑wp-config.php)。
DB_COLLATE
留为空白的数据库排序(参见zh-cn:编辑wp-config.php)。
在标有
* Authentication Unique Keys.
的版块下输入密钥的值,保存wp-config.php文件。
cp -a wordpress/. /usr/share/nginx/www/
在浏览器中访问:
http://example.com/wp-admin/install.php
9.配置Wordpress
a)设置wp-content目录权限
sudo chmod 777 /usr/share/nginx/www/wp-content
b)安装静态化插件
设置nginx下Wordpress伪静态规则:
修改nginx配置文件:
sudo vi /etc/nginx/nginx.conf
修改相应配置信息,改成如下内容:
location /
{
try_files $uri $uri/ /index.php?q=$uri&$args;
}
重启nginx.
网站根目录下新建html目录和index.bak文件:
sudo mkdir /usr/share/nginx/www/html
sudo chmod 777 /usr/share/nginx/www/html
sudo vi /usr/share/nginx/www/index.bak
sudo chmod 666 /usr/share/nginx/www/index.bak
下载并拷贝至wordpress插件目录:
wget http://downloads.wordpress.org/plugin/cos-html-cache.zip
unzip cos-html-cache.zip
cp -r cos-html-cache /usr/share/nginx/www/wp-content/plugins
在wordpress中设置固定链接,如以下格式:
/html/archives/%post_id%.html
开启插件cos-html-cache
10.附录
1、nginx配置修改及生效:
sudo vi /etc/nginx/nginx.conf //修改配置
sudo vi /etc/nginx/sites-enabled/default //修改配置
sudo service nginx restart //重启nginx
2、php配置修改及生效:
sudo vi /etc/php5/fpm/php.ini //修改配置
sudo service php5-fpm restart //重启fastcgi进程
3、mysql配置修改及生效:
sudo vi etc/mysql/my.cnf //修改配置
sudo service mysql restart //重启Mysql
分享到:
相关推荐
这是10。04LTS的离线汉化包,专给没办法连网的同志用的,希望能帮助到你们。。。。
NULL 博文链接:https://ethanwooblog.iteye.com/blog/1340252
Ubuntu Server 10.04中文环境乱码解决办法
Ubuntu_10.04 安装、配置、指南
1、安装ubuntu server 10.04或10.10,其中安装语言选的en,时区shanghai,服务只安装ssh,其他全部用默认就行。 提示:以上安装过程完成后,建议用其他计算机登录服务器,windows系统可以用putty,linux系统直接在...
android2.2源码编译-Ubuntu10.04 (X86) + android2.2 + JDK1.6android2.2源码编译-Ubuntu10.04 (X86) + android2.2 + JDK1.6android2.2源码编译-Ubuntu10.04 (X86) + android2.2 + JDK1.6
ubuntu-10.04-desktop-amd64.iso.torrent, Ubuntu Lucid amd64位下载种子
不用wubi,直接进行ubuntu_10.04的硬盘安装,系统更加稳定。
在ubuntu 10.04上安装subversion+sasl谁用户的全过程
ubuntu10.04安装配置指南.docx
家里的老笔记本装了诸多新版Ubuntu均不稳定,最终还是装回了10.04,结果安装最新版的方式得到的最新版本已经不能兼容10.04了。于是上网找了Chrome稳定版本的历史版本,然后本地下载各种版本尝试安装,得到了最新可...
ubuntu10.04 安装 opencv2.2.0
#dpkg -i language-pack-zh-hans_1%3a10.04+20100421_all.deb language-pack-zh-hans-base_1%3a10.04+20100421_all.deb language-pack-gnome-zh-hans-base_1%3a10.04+20100421_all.deb language-pack-gnome-zh-hans_...
在ubuntu 10.04下安装svn server的过程;包括配置和client的使用等
Ubuntu_10.04操作系统安装全过程截图指南 Ubuntu_10.04操作系统安装全过程截图指南
Ubuntu_10.04上编译Android_2.3Ubuntu_10.04上编译Android_2.3
介绍最新版本Ubuntu10.04的安装,配置,shell编程等内容,快速入门提高的资料。 分两卷: Ubuntu10.04入门教程01 Ubuntu10.04入门教程02
VM7安装Ubuntu 10.04系统 VM7安装Ubuntu 10.04系统