Ubuntu 16.10 Apache PHP Server

简介: /******************************************************************************************* * Ubuntu 16.10 Apache PHP Server * 说明: * 需要用到16.10系统上装一个PHP的环境来做代码测试,记录一下几个关键的配置。
/*******************************************************************************************
 *                           Ubuntu 16.10 Apache PHP Server 
 * 说明:
 *     需要用到16.10系统上装一个PHP的环境来做代码测试,记录一下几个关键的配置。
 *
 *                                                        2017-2-27 深圳 南山平山村 曾剑锋
 ******************************************************************************************/

一、参考文档:
    1. Apache提示You don't have permission to access / on this server问题解决
        http://sjpsega.iteye.com/blog/1507439 
    2. Multiple ports on Apache2
        http://serverfault.com/questions/722493/multiple-ports-on-apache2

二、开启端口
    /etc/apache2/ports.conf
        # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in
        # /etc/apache2/sites-enabled/000-default.conf
        
        Listen 80
        
        <IfModule ssl_module>
                Listen 443
        </IfModule>
        
        <IfModule mod_gnutls.c>
                Listen 443
        </IfModule>
        
        listen 8888   # 开启独立的端口
        
        # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

三、配置路径
    /etc/apache2/sites-available/001-ARMDesktop.conf
        <VirtualHost *:8888> # The ServerName directive sets the request scheme, hostname and port that
                # the server uses to identify itself. This is used when creating
                # redirection URLs. In the context of virtual hosts, the ServerName
                # specifies what hostname must appear in the request's Host: header to
                # match this virtual host. For the default virtual host (this file) this
                # value is not decisive as it is used as a last resort host regardless.
                # However, you must set it for any further virtual host explicitly.
                #ServerName www.example.com
        
                ServerAdmin webmaster@localhost
                DocumentRoot /home/zengjf/zengjf/zengjfos/ARMDesktop
        
                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn
        
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
        
                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf
        </VirtualHost>
        
        # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

四、error:
    1. You don't have permission to access / on this server.

    2. 解决办法:
        /etc/apache2/apache2.conf
            ...
            # Sets the default security model of the Apache2 HTTPD server. It does
            # not allow access to the root filesystem outside of /usr/share and /var/www.
            # The former is used by web applications packaged in Debian,
            # the latter may be used for local directories served by the web server. If
            # your system is serving content from a sub-directory in /srv you must allow
            # access here, or in any related virtual host.
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
                    Require all denied
            </Directory>
            
            <Directory /usr/share>
                    AllowOverride None
                    Require all granted
            </Directory>
            
            <Directory /var/www/>
                    Options Indexes FollowSymLinks
                    AllowOverride None
                    Require all granted
            </Directory>
            
            <Directory /home/zengjf/zengjf/zengjfos/ARMDesktop>
                    Options Indexes FollowSymLinks
                    Require all granted
            </Directory>
            
            #<Directory /srv/>
            #       Options Indexes FollowSymLinks
            #       AllowOverride None
            #       Require all granted
            #</Directory>
            ...
 

 

目录
相关文章
|
12月前
|
Ubuntu 安全 Docker
Ubuntu Server上安装配置Docker的详细步骤
如果一切设置正确,这将下载一个测试镜像,并在容器中运行它,打印一条问候消息。
1657 76
|
Ubuntu 安全 Linux
ubuntu2404 Server扩展PV
通过以上步骤,你可以成功扩展Ubuntu 24.04 Server上的物理卷。该过程包括创建新分区、将其添加到现有PV、扩展逻辑卷和相应的文件系统。扩展完成后,服务器将能够使用新增的存储空间,确保系统运行更加高效和稳定。
552 77
|
Ubuntu 网络协议 虚拟化
在VMware环境安装Ubuntu Server中遇到的无法安装问题
安装Ubuntu Server中遇到的无法安装问题解决思路
|
Ubuntu PHP
Ubuntu下使用apt为Apache2编译PHP7.1
以上就是在Ubuntu系统下,使用apt为Apache2编译PHP7.1的过程。希望这个过程对你有所帮助,如果你在执行过程中遇到任何问题,都可以在网上找到相关的解决方案。
316 25
|
Ubuntu PHP Apache
在Ubuntu系统中为apt的apache2编译PHP 7.1的方法
以上就是在Ubuntu系统中为apt的apache2编译PHP 7.1的方法。希望这个指南能帮助你成功编译PHP 7.1,并在你的Apache服务器上运行PHP应用。
357 28
|
Ubuntu 编译器 开发工具
基于Ubuntu Server的YTM32 SDK工程编译
希望这个“烹饪”比喻能帮助你理解SDK工程编译的过程。记住,编程就像烹饪一样,需要耐心,实践,和不断的学习。祝你烹饪愉快!
289 21
|
Ubuntu 虚拟化 Windows
无影云电脑选择哪个操作系统Windows server 2019还是Ubuntu?
在选择阿里云无影云电脑的操作系统时,Windows Server 2019 和 Ubuntu 各有优势。Windows适合依赖微软生态的企业级应用,提供图形化界面和高安全性;Ubuntu则轻量、经济,适合开源工具链和容器化部署。根据应用场景、资源占用、安全性、开发效率及成本考量,选择最适合的系统。条件允许下,可采用混合方案满足多样化需求。
|
Ubuntu PHP 数据库
|
Ubuntu 网络协议 关系型数据库
超聚变服务器2288H V6使用 iBMC 安装 Ubuntu Server 24.04 LTS及后续系统配置
【11月更文挑战第15天】本文档详细介绍了如何使用iBMC在超聚变服务器2288H V6上安装Ubuntu Server 24.04 LTS,包括连接iBMC管理口、登录iBMC管理界面、配置RAID、安装系统以及后续系统配置等步骤。
5137 4
|
数据库连接 PHP Apache
PHP在Apache中如何运行?
PHP在Apache中如何运行?
578 5