分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

ubuntu14.04.1配置apache与yum

发布时间:2023-09-06 02:32责任编辑:白小东关键词:apache配置
1、安装apahce

apt-get install apache2

2、默认网站根目录

Apache的安装路径为/var

默认的网站根目录的路径为/var/www/html

3、配置apache自启动

Apache2.conf 位置: /etc/apache2/apache2.conf

vim /etc/apache2/apache2.conf

在打开的apache2.conf文件尾部添加如下信息:

#ServerName

ServerName [ip地址]

4、重启apache

目录:/etc/init.d/apache2 restart

./apache2 restart
5、重启电脑,检测服务能否自启动;本机访问

浏览器输 http:[之前配置的ip地址] 回车之后看到

配置基于http的包更新源
1、在终端窗口中输入"sudo vi /etc/apache2/apache2.conf" ??,回车,找到"<Directory /var/www/>"的位置,更改"/var/www/"为新的根目录就可以了
<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>

2,在终端窗口中输入"sudo vi /etc/apache2/sites-available/000-default.conf"-->回车-->找到"DocumentRoot /var/www/html"的位置-->更改"/var/www/html"为新的根目录就可以了,这里我把它更改为"/var/www/" 或者也可以自己新建一个repo_server.conf,里面配置如下:
<VirtualHost :28000>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/repo
<Directory ‘/var/www/repo‘>
Options Includes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
ErrorLog /var/log/apache2/repo_server-error.log
CustomLog /var/log/apache2/repo_server.log common
</VirtualHost>
注:repo下要拷贝iso上的dists目录过来
3、配置端口
在/etc/apache2/ports.conf
输入Listen
:28000
保存退出

第六步:重启Apache:

在终端窗口中输入"sudo /etc/init.d/apache2 restart" ?回车,输入root用户密码,回车,重启成功

客户端配置
1、找到/etc/apt/sources.list
2、输入deb [arch=amd64] ?http://11.11.177.72:28000 (dists)ngiam main
3、保存退出即可

ubuntu14.04.1配置apache与yum

原文地址:http://blog.51cto.com/xjsunjie/2348168

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved