ubuntu 添加apache源_ubuntu apache2.4源 - CSDN
精华内容
参与话题
  • UbuntuApache安装和配置

    万次阅读 2018-08-06 08:49:12
    Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令;2 从源码构建Apache。 方法一:使用开发包的打包服务——apt-get 安装apache,在命令行终端中输入一下命令: $ sudo apt-get ...

     

    在Ubuntu上安装Apache,有两种方式:1 使用开发包的打包服务,例如使用apt-get命令;2 从源码构建Apache。

    方法一:使用开发包的打包服务——apt-get

    安装apache,在命令行终端中输入一下命令:

    $ sudo apt-get install apache2

    安装完成后,重启apache服务,在命令行终端中输入一下命令:

    $ sudo /etc/init.d/apache2 restart

    可能会出现的问题1: NameVirtualHost *:80 has no VirtualHosts

    出现上述问题的原因:定义了多个NameVirtualHost,故将/etc/apache2/ports.conf中的NameVirtualHost *:80注释掉即可。

    可能会出现的问题2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

    原因:根据提示,无法可靠的确定服务器的有效域名,使用127.0.1.1作为服务器域名。应此,在下面的测试中,应该使用127.0.1.1,而不是127.0.0.1!

    解决:
    $ vim /etc/apache2/httpd.conf,在文件中添加:

    ServerName localhost:80,再次重启apache2,就可以使用127.0.0.1来访问web服务器啦!

    测试:

    在浏览器里输入http://localhost或者是http://127.0.0.1,如果看到了It works!,那就说明Apache就成功的安装了,Apache的默认安装,会在/var下建立一个名为www的目录,这个就是Web目录了,所有要能过浏览器访问的Web文件都要放到这个目录里。

    测试过程中可能遇到问题:404 not found

    原因:apache2使用的服务器地址不是127.0.0.1,根据在前面的分析,可能的ip为127.0.1.1,访问http://127.0.1.1即可。

    如果觉得不再需要apache了,可以将它卸载:

    1. 删除apache
    在命令行中输入:
    $ sudo apt-get --purge remove apache-common
    $ sudo apt-get --purge remove apache

    2.找到没有删除掉的配置文件,一并删除
    代码:
    $ sudo find /etc -name "*apache*" |xargs rm -rf 
    $ sudo rm -rf /var/www
    $sudo rm -rf /etc/libapache2-mod-jk

    3.删除关联,这样就可以再次用apt-get install apache2 重装了
    #dpkg -l |grep apache2|awk '{print $2}'|xargs dpkg -P

    方法二:从源构建Apache

    参考资料:

    Ubuntu下安装Apache+PHP+MySQL:http://www.linuxidc.com/Linux/2012-05/61079.htm

    Ubuntu下彻底卸载Apache2:http://www.linuxidc.com/Linux/2013-06/85825.htm

    Apache问题解决:httpd: Could not reliably determine the server's fully qualified domain name 链接:http://www.linuxidc.com/Linux/2012-08/68901.htm

    --------------------------------------分割线--------------------------------------

    apache2 [warn] NameVirtualHost *:80 has no VirtualHosts的解决方法

    错误:[warn] NameVirtualHost *:80 has no VirtualHosts 
     
    原因:定义了多个NameVirtualHost
     
    解决:Ubuntu之前的版本定义在/etc/apache2/sites-available/default, 8.04后在/etc/apache2/ports.conf
     
    故可以将/etc/apache2/ports.conf中的NameVirtualHost *:80注释掉
     
    这个问题的本质是在没有定义域名是一个端口只能对应一个虚拟主机,将NameVirtualHost *:80改为其他端口也可以解决
     
    如果有多个不同的域名的话,用同样的端口也可以

    展开全文
  • ubuntu更新添加方法

    千次阅读 2012-01-15 13:42:46
    下面是国内的ubutnu更新: 打开终端sudo gedit /etc/apt/sources.list 输入密码,回车 在文件末尾添加以下内容: # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ dists/...

    下面是国内的ubutnu更新源:

    打开终端sudo gedit /etc/apt/sources.list

    输入密码,回车

    在文件末尾添加以下内容:

    # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ dists/oneiric/main/binary-i386/
    
    # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ oneiric main restricted
    
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric main restricted
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric universe
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric universe
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates universe
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
    ## team, and may not be under a free licence. Please satisfy yourself as to 
    ## your rights to use the software. Also, please note that software in 
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric multiverse
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
    
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    deb http://cn.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse
    
    deb http://security.ubuntu.com/ubuntu oneiric-security main restricted
    deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted
    deb http://security.ubuntu.com/ubuntu oneiric-security universe
    deb-src http://security.ubuntu.com/ubuntu oneiric-security universe
    deb http://security.ubuntu.com/ubuntu oneiric-security multiverse
    deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse
    
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    # deb http://archive.canonical.com/ubuntu oneiric partner
    # deb-src http://archive.canonical.com/ubuntu oneiric partner
    
    ## This software is not part of Ubuntu, but is offered by third-party
    ## developers who want to ship their latest software.
    deb http://extras.ubuntu.com/ubuntu oneiric main
    deb-src http://extras.ubuntu.com/ubuntu oneiric main
    
    ## 网易开源镜像站
    deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##台湾源
    deb http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
    deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
    deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
    
    
    
    ##SRT Sources
    
    deb http://ubuntu.srt.cn/ubuntu/ oneiric main restricted universe multiverse
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-security main restricted universe multiverse
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates main restricted universe multiverse
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports main restricted universe multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main restricted universe multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security main restricted universe multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates main restricted universe multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports main restricted universe multiverse
    
    ##网易 Ubuntu 11.10 源(速度很快)
    
    deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##ubuntu 11.10 上海源,提供 Kernel,Hiweed,ubuntu
    deb http://mirror.rootguide.org/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirror.rootguide.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##搜狐 Ubuntu 11.10 源
    deb http://mirrors.shlug.org/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirrors.shlug.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin
    deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##lupaworld Ubuntu 11.10源,提供 ArchLinux,Everest,FreeBSD,Fedora,LFS,Magiclinux,Mandriva,OpenOffice,openSUSE,Puppy,Red Hat,Slitaz,Turbolinux,Ubuntu,中标普华
    
    
    deb http://mirror.lupaworld.com/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirror.lupaworld.com/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirror.lupaworld.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirror.lupaworld.com/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirror.lupaworld.com/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirror.lupaworld.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirror.lupaworld.com/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirror.lupaworld.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.lupaworld.com/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.lupaworld.com/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##rootguide源,ubuntu官方上海源,提供 Kernel,Hiweed,ubuntu
    
    deb http://mirror.rootguide.org/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirror.rootguide.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirror.rootguide.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirror.rootguide.org/ubuntu/ oneiric-updates universe main multiverse restricted
    
    ##搜狐开源镜像站,提供 CPAN,FreeBSD,NetBSD,OpenBSD,apache,archlinux,centos,cygwin,dag,debian,fedora,gentoo,kernel,lfs,mysql,nginx,openSUSE,php,rpmfusion,slackware,ubuntu
    
    deb http://mirrors.shlug.org/ubuntu/ oneiric main universe restricted multiverse
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric main universe restricted multiverse
    deb http://mirrors.shlug.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-security universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-updates universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-proposed universe main multiverse restricted
    deb http://mirrors.shlug.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-backports universe main multiverse restricted
    deb-src http://mirrors.shlug.org/ubuntu/ oneiric-updates universe main multiverse restricted
    
    
    #防止非官方源中软件包不全的问题,请在sources.list文件中尾部添加下面这个官方源。
    deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse
    
    
    注:本文参考了以下网站:
       http://www.cnblogs.com/weisteve/archive/2011/10/17/2215390.html
    展开全文
  • apache源代码下载地址http://httpd.apache.org/download.cgi#apache22tomcat二进制代码包下载地址:http://tomcat.apache.org/download-70.cgiJDK 下载地址:...

     

    整合的平台环境如下:
    载和编译mod_jk.so 下载地址:http://tomcat.apache.org/download-connectors.cgi
    下面是安装步骤:
    需要安装Gcc编译环境,这个在上面的文章里已经介绍过,这里不再赘述。
    第一步;安装JDK
             # mount /dev/cdrom /media/
             # cd /media/
             # cp jdk-1_6_22-linux-i586-rpm.bin /usr/local/src/
             # cd /usr/local/src/
             # chmod 755 jdk-1_6_22-linux-i586-rpm.bin
             # ./jdk-1_6_22-linux-i586-rpm.bin
      Do you agree to the above license terms? [yes or no]
    此时选择yes,
    安装成功,可以看到/usr/java/jdk 1.6.0_22/     目录
    配置环境变量:cp /etc/profile /etc/profile.bak
    vim /etc/profile
    在最后添加:
    export JAVA_HOME=/usr/java/jdk 1.6.0_22
    export JAVA_BIN=/usr/java/jdk 1.6.0_22/bin
    export PATH=$PATH:$JAVA_HOME/bin
    export CLASSPATH==.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export JAVA_HOME JAVA_BIN PATH CLASSPATH

    source /etc/profile
    第二步:安装 tomcat 非常简单:#cd /usr/local/src
    #cp /media/apache-tomcat-7.0.18.tar.gz /usr/local/src
     #tar xvfz /media/apache-tomcat-7.0.18.tar.gz
     
    启动 tomcat : /usr/local/tomcat7/bin/startup.sh 
    停止 tomcat : /usr/local/tomcat7/bin/shutdown.sh 

    第三步:安装 apache
    # cd /usr/local/src
    #cp /media/httpd-2.2.11.tar.gz  /usr/local/src
    #tar xvfz httpd-2.2.11.tar.gz
     #cd httpd-2.2.11/
     #mkdir /usr/local/apache2
    # ./configure --prefix=/usr/local/apache2 --enable-so
    # make 
     #make install
     安装完毕!
    开始作tomcat7.0+apache2.2的整合了
    第一步是修改httpd.conf 这个全局设定档。
    cd /usr/local/apache2/conf/
    cp http.conf http.conf.bak
    vim http.conf
    ServerName 配置为 127.0.0.1:80,服务器IP或域名

    DirectoryIndex 中添加index.htm index.jsp
    :wq 保存后退出
    此时可启动apache2.0服务器了
    采用:/usr/local/apache2/bin/apachectl start
    输入:http://127.0.0.1/
    你就会看到 It works!
    这个测试成功的界面。
    启动tomcat 采用:/usr/local/tomcat6/bin/startup.sh
    输入:http://127.0.0.1:8080/
    你就会看到tomcat 的测试页面
    第二步是下载和编译mod_jk.so 这个连接tomcat和apache.的连接文件。
    照样也是在http://tomcat.apache.org 这个网站上下载的源代码安装包:tomcat-connectors-1.2.27-src.tar.gz
    首先: mkdir /usr/source.bao 
         #cp /media/tomcat-connectors-1.2.27-src.tar.gz /usr/source.bao
          #cd /usr/local/src
          #tar xvfz /usr/source.bao/tomcat-connectors-1.2.27-src.tar.gz
          #cd tomcat-connectors-1.2.27-src/
          注意里面有一个BUILD.txt 仔细阅读它
          然后 cd native/
          #vim BUILDING.txt  仔细阅读它
          然后输入采用: 
          # ./configure --with-apxs=/usr/local/apache2/bin/apxs  --with-java-home=/usr/java/jdk 1.6.0_22
          #make
          #make isntall
          #cp apache-2.0/mod_jk.so /usr/local/apache2/modules/   
         这一步很重要
       
    第三步:在/usr/local/apache2/conf/下面建立两个配置文件mod_jk.conf和workers.properties。
          vim mod_jk.conf
    添加以下代码:
    # 指出mod_jk模块工作所需要的工作文件workers.properties的位置
    JkWorkersFile /usr/local/apache2/conf/workers.properties

    # Where to put jk logs
    JkLogFile /usr/local/apache2/logs/mod_jk.log

    # Set the jk log level [debug/error/info]
    JkLogLevel info

    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

    # JkOptions indicate to send SSL KEY SIZE, 
    JkOptions  +ForwardKeySize +ForwardURICompat -ForwardDirectories

    # JkRequestLogFormat set the request format 
    JkRequestLogFormat "%w %V %T"

    # 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
    JkMount /servlet/*  worker1
    JkMount /*.jsp worker1

    vim workers.properties
    添加以下代码:
    # Defining a worker named worker1 and of type ajp13
    worker.list=worker1

    # Set properties for worker1
    worker.worker1.type=ajp13  
    worker.worker1.host=localhost  
    worker.worker1.port=8009
    worker.worker1.lbfactor=50  
    worker.worker1.cachesize=10  
    worker.worker1.cache_timeout=600  
    worker.worker1.socket_keepalive=1  
    worker.worker1.socket_timeout=300


    再配置httpd.conf,作以下修改:
    将Listen 80 修改为 Listen 127.0.0.1:80
    将ServerName 修改为 ServerName LocalHost:80

    我的网页放在/var/wwwroot下,所以要修改DocumentRoot
    添加代码:
    DocumentRoot "/opt/tomcat7/webapps"
    <Directory "webapps">
        Options Includes FollowSymLinks
        AllowOverride None
        Order deny,allow
        Allow from all
        XBitHack on
    </Directory>
    <Directory "webapps/WEB-INF">     
        Order deny,allow
        Deny from all
    </Directory>
    增加关于加载mod_jk的语句:
    添加代码:
    LoadModule jk_module modules/mod_jk.so
    Include /usr/local/apache2/conf/mod_jk.conf



    最后编辑Tomcat的配置文件server.xml,在HOST段中加入:
    <Context path="" docBase="webapps" 
          debug="0" reloadable="true" crossContext="true"/>

    在webapps下建立一个test.jsp,启动Apache和Tomcat,用浏览器访问http://localhost/,应该可以看到正确的页面了。
     
    test.jsp 的例子
    Hello! The time is <%= new java.util.Date() %>


    输入http://127.0.0.1/test.jsp
    你会看到:Hello! The time is Sun Oct 17 08:51:33 PDT 2010
    OK 你成功了!

     

    展开全文
  • 假如你的apache 服务器的ip是 172.16.56.155 ...1. 在apache的httpd.conf中添加 ServerName 172.16.56.155 NameVirtualHost 172.16.56.155 ServerName 172.16.56.155 DocumentRoot /var/www...
    假如你的apache 服务器的ip是 172.16.56.155

    1. 在apache的httpd.conf中添加

    ServerName 172.16.56.155
    NameVirtualHost 172.16.56.155
    <VirtualHost 172.16.56.155>
    ServerName 172.16.56.155
    DocumentRoot /var/www/
    <Directory "/var/www">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    2. 创建文件夹 /var/www/packages/i3186 和 /var/www/packages/amd64
    然后把你想让其他服务器想用的deb安装包都放置到这两个文件夹中 其中1386 是放置的32位系统的安装包

    3.执行如下的三个命令
    cd /var/www/packages

    dpkg-scanpackages i386 /dev/null | gzip > i386/Packages.gz
    dpkg-scanpackages amd64 /dev/null | gzip > amd64/Packages.gz
    4.修改本服务器的/etc/apt/source.list文件,注释掉其他的东西添加如下的语句
    deb file:/var/www/packages/amd64/ /
    5.在本机执行 apt-get update
    6. 重启apache service apache2 restart
    7 服务器配置完毕了


    8.在另一个电脑上 修改 /etc/apt/source.list
    deb http://172.16.56.155/packages/ amd64/
    并且执行 apt-get update
    9 下面就可以安装你想安装的软件了这些安装的包都是放在自己的服务器源上


    展开全文
  • Ubuntu16.04下搭建SVN服务器+apache2搭建SVN服务器:采用Apache2+svn,http访问方式1.先确定安装了Apache2, 没有安装的话,使用以下命令:sudo apt-get install apache22.然后下载安装svn服务和svn-apache连接库,...
  • 概述 说了centos的epel搭建方式后,在说下ubuntu镜像及openstack本地的搭建。步骤1.安装apt-mirror#apt-getinstallapt-mirror2.手动建立/apt/ubuntu目录,并修改/etc/apt/mirror.list,添加如下内容:########...
  • 已经添加了 AddHandler php5-script .php .html AddType text/html .php .html <IfModule dir_module> DirectoryIndex index.html index.php 仍然你没有效果,自己估计应该是apache配置有问题但不知道怎么改,...
  • 安装了apache以后,发现无法解析.php文件,然后网上百度了很久,好多都是下载代码编译安装的php,而我是用apt安装的,因此,许多路径方法都不对,找了好久,终于看到这篇帖子,按照步骤一步步检查,最后终于成功...
  • win10下的ubuntu下安装Apache

    千次阅读 2018-06-01 08:58:21
    根据Linux的系统的版本找到合适的安装方式 在Fedora / CentOS / Red Hat Enterprise Linux上安装 sudo yum安装httpd sudo systemctl启用httpd sudo systemctl启动httpd 较新版本的这些发行版使用 dnf而不是yum...
  • 首先说一下,Ubuntu中常用的安装软件的方法有两种: 1. apt-get方法 使用apt-get install来安装应用程序算是最常见的一种安装方法,apt-get的基本软件安装命令是: sudo apt-get install 软件名 2. make install...
  • Ubuntu 安装 PHP7.2 和 Apache2

    千次阅读 2019-04-23 14:49:52
    Ubuntu 安装 PHP7 和 Apache2 Ubuntu 安装 PHP7 和 Apache2 1、准备工作 2、安装 PHP7.2 和 Apache2 3、查看PHP 环境信息以及相关的模块 4、安装phpMyadmin 5、访问phpMyadmin是否成功 1、...
  • ubuntu16.04下默认安装的是php7,由于想要换成主流的php5,所以就有了此文。 可能遇到的报错:Fatal error: Call to undefined function mysql_connect()
  • 话说网上资料很多,但是精品很少,步骤文档多为重复,而且有些文档还丢失步骤,导致别人安装出现各种问题。    这篇Step-By-Step文档就是在花了很多时间网上查阅资料,当然主要是结合自己的安装流程编写的。...
  • ubuntu SVN Apache SSL https 安装 与 配置

    千次阅读 2014-09-17 20:07:01
    ps: 我的环境 Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-30-generic x86_64) ps: 我的 是
  • Ubuntu+Apache+PHP+Mysql环境搭建(完整版) 一、操作系统Ubuntu 14.04 64位,阿里云服务器 二、Apache 1、安装Apache,安装命令:sudo apt-get install apache2 2、环境配置: 1)配置文件:路径为/etc/apache...
  • 在这个例子中,我们将看到如何在Ubuntu系统上安装Apache Hadoop的细节。我们将完成所有必需的步骤,从Apache Hadoop所需的先决条件开始,然后是如何配置Hadoop,我们将通过学习如何将数据插入Hadoop以及如何对该数据...
  •   首先来介绍下apache的一个工具apxs。apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具,用于编译一个或多个程序或目标代码文件为动态共享对象,使之可以用由mod_so提供...注意在Ubuntu apache2下 apx...
  • Ubuntu 10.10更新列表(ubuntu10.10Ubuntu 10.10 已经发布了,下面提供更新方法与更新列表地址 1.sudo gedit /etc/apt/sources.list(最好备份一下:sudo cp /etc/apt/sources.list /etc/apt/sources....
  • ubuntu+apache2+rails

    千次阅读 2010-06-24 15:40:00
    Ubuntu上部署Rails(Apache mod_proxy mongrel_cluster) <br /> 最近需要把Rails的程序发布出去,在发布的过程中遇到了一些问题,虽然都用Google解决了,不过也注意到,在Ubuntu下部署Rails和其它...
  • ​ 如果存在无法连接公网的情况并且有多台服务器需要安装多个软件,可以使用mirror做一个本地仓库,使其其他机器可以通过本地仓库下载需要的软件,本地仓库需要使用Apache2,具体配置可以参考Apache2 1.2 配置过程 ...
1 2 3 4 5 ... 20
收藏数 13,640
精华内容 5,456
关键字:

ubuntu 添加apache源