aa0660 发表于 2019-4-19 08:48:17

ubuntu14.04.1配置apache与yum

  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
  4、重启apache
  目录:/etc/init.d/apache2 restart
  ./apache2 restart
5、重启电脑,检测服务能否自启动;本机访问
  浏览器输 http:[之前配置的ip地址] 回车之后看到
https://s1.运维网.com/images/blog/201901/31/b650b461f5f4a54fba74185b8f4442af.png
  配置基于http的包更新源
1、在终端窗口中输入"sudo vi /etc/apache2/apache2.conf"   ,回车,找到""的位置,更改"/var/www/"为新的根目录就可以了

Options FollowSymLinks
AllowOverride None
Require all denied

  
AllowOverride None
Require all granted

  
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

  2,在终端窗口中输入"sudo vi /etc/apache2/sites-available/000-default.conf"-->回车-->找到"DocumentRoot /var/www/html"的位置-->更改"/var/www/html"为新的根目录就可以了,这里我把它更改为"/var/www/" 或者也可以自己新建一个repo_server.conf,里面配置如下:

ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/repo

Options Includes FollowSymLinks MultiViews
AllowOverride None
Require all granted

ErrorLog /var/log/apache2/repo_server-error.log
CustomLog /var/log/apache2/repo_server.log common

注: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 http://11.11.177.72:28000 (dists)ngiam main
3、保存退出即可



页: [1]
查看完整版本: ubuntu14.04.1配置apache与yum