ubuntu14.04.1配置apache与yum

一、安装apahcehtml

apt-get install apache2web

二、默认网站根目录apache

Apache的安装路径为/varubuntu

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

三、配置apache自启动浏览器

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

vim /etc/apache2/apache2.conf网站

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

#ServerNamerest

ServerName [ip地址]

四、重启apache

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

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

浏览器输 http:[以前配置的ip地址] 回车以后看到
ubuntu14.04.1配置apache与yum

配置基于http的包更新源
一、在终端窗口中输入"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目录过来
三、配置端口
在/etc/apache2/ports.conf
输入Listen
:28000
保存退出

第六步:重启Apache:

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

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

相关文章
相关标签/搜索