Centos配置ftp和lamp服务器
ftp:http://www.dedecms.com/knowledge/servers/linux-bsd/2012/0819/8497.html
lamp:http://www.jb51.net/article/37987.htm
如果要配置多个站点则在/etc/httpd/conf/httpd.conf最后配置:
虚拟主机可以是基于 IP地址,即每个 IP 一个站点;
<VirtualHost www.lunax.info>
ServerAdmin [email protected]
DocumentRoot /groups/lunax/www
ServerName www.lunax.info
ErrorLog /groups/lunax/logs/error_log
TransferLog /groups/lunax/logs/access_log
</VirtualHost>
<VirtualHost www.lunax.org>
ServerAdmin [email protected]
DocumentRoot /groups/lunax/www
ServerName www.lunax.org
ErrorLog /groups/lunax/logs/error_log
TransferLog /groups/lunax/logs/access_log
也可以是基于名称, 即每个 IP 多个站点。这些站点运行在vps服务器而对于用户来说看起来是唯一的战点。
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
mysql添加本地和远程都可登陆用户:
insert into mysql.user (host,user,password) values('%','jifei',PASSWORD('jifei'));
grant select on 数据库.* to '用户名'@'登录主机' identified by '密码';
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'jifei'@'%' IDENTIFIED BY '' ;
flush privileges;
添加用户并赋予密码
$ useradd XXX
$ passwd XXX
赋予用户sudo权限
在/etc/sudoers文件末端加上 XX ALL=(ALL) ALL