apache
在Ubuntu Linux上用
apt-get install apache2
安装Apache2后,竟然发现没有httpd.conf(位于/etc/apache2目录)
Ubuntu的Apache的配置文件是 /etc/apache2/apache2.conf
Web文档根目录默认在/var/www定义在
在 /etc/apache2/sites-enabled/000-default中
DocumentRoot /var/www/html
/etc/apache2/ports.conf,这里面设置了Apache使用的端口
说明:
/etc/apache2目录下
sites-available目录,放是真正的配置文件
ites- enabled目录存放的是指向这里的文件的符号链接
启动、重启、停止apache服务
sudo service apache2 start
sudo service apache2 restart
sudo service apache2 stop
创建VirtualHost
<VirtualHost 192.168.0.107:80> DocumentRoot /web/ ServerName 192.168.0.107:80 <Directory "/web/"> Options Indexes FollowSymLinks AllowOverride All Require all granted AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
启动Apache的Rewrite功能
sudo a2enmod rewrite
php
更新源列表,否则安装php会失败
vi /etc/apt/source.list
在最前面添加
deb http://mirrors.aliyun.com/ubuntu/ precise main restricteduniverse multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-security mainrestricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-updates mainrestricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-proposed mainrestricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-backports mainrestricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise mainrestricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-securitymain restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-updatesmain restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposedmain restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-backportsmain restricted universe multiverse
sudo apt-get update
安装PHP
sudo apt-get install php5
重启服务器
mysql
sudo apt-get install mysql-server
启动、重启、停止mysql服务
service mysql start
service mysql restart
service mysql stop
mysql 允许root远程登录
grant all privileges on *.* to root@"%" identified by "123456" with grant option;
修改配置文件/etc/mysql/my.cnf,把bind-address = 127.0.0.1注释掉
#bind-address = 127.0.0.1
查看本机ip地址
ifconfig -a
在winows下用Navicat,新建连接,能正常访问mysql
FTP
sudo apt-get install vsftpd
查看是否安装成功
sudo service vsftpd restart
建立ftp目录
sudo mkdir /home/ftpfile/ftpfile
新建ftp用户
sudo useradd –d /home/ftpfile –s /bin/bash baby
设置myftp用户密码
sudo passwd baby
修改ftp配置文件/etc/vsftpd.conf
anonymous_enable=NO local_enable=YES write_enable=YES chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
在/etc/目录中新建vsftpd.chroot_list文件
baby
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/20414.html