zoukankan      html  css  js  c++  java
  • ubuntu下lamp配置

    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
  • 相关阅读:
    Java59道常见面试题,内附答案
    2020年一个月时间面试字节跳动,面试经历分享(已拿offer)
    阿里总结的《Java成神之路》 PDF 火了,完整版开放下载!
    Github14k堪称神级的Spring Boot手册,从基础入门到实战进阶
    三面阿里(支付宝)Java高开岗,复习两月有幸拿到offer
    Java 最常见的 200+ 面试题:面试必备
    【面试总结】终于拿到了美团offer了,没有辜负了这三个月的努力啊
    阿里P9都赞不绝口的面试宝典!半月看完25大专题,居然斩获阿里P7offer
    Integer是int
    抽象类和接口
  • 原文地址:https://www.cnblogs.com/baby123/p/5257569.html
Copyright © 2011-2022 走看看