centos下apache+passenger运行redmine

[b][size=large]1、linux下源码编译redmine(待续...)[/size][/b]
[b][size=large]2、源码编译apache[/size][/b]
省略
[b][size=large]3、源码编译passenger[/size][/b]

wget http://rubyforge.org/frs/download.php/75548/passenger-3.0.11.tar.gz
tar -zxvf passenger-3.0.11.tar.gz
cp passenger-3.0.11 /usr/local
cd /usr/local/passenger-3.0.11
./bin/passenger-install-apache2-module


[b][size=large]4、安装完成后修改apache的http.conf文件[/size][/b]
passenger安装完成后会出现如下提示:
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!

AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/u01/passenger-2.2.11/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl)

http://www.modrails.com/


根据上面的提示,添加Passenger的配置到httpd.conf中:
LoadModule passenger_module /usr/local/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby

在httpd.conf中添加虚拟主机:
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@xxxxxx.com
DocumentRoot /opt/redmine-1.2/public
ErrorLog logs/redmine_error_log

<Directory “/opt/redmine-1.2/public”>
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>


[size=large][b]5、重启apache[/b][/size]
/etc/init.d/httpd restart
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 系统上搭建 Web 服务器的步骤如下: 1. 安装 Apache HTTP 服务器:可以使用以下命令在 CentOS 系统上安装 Apache: ``` sudo yum install httpd ``` 2. 安装 MySQL 数据库:可以使用以下命令在 CentOS 系统上安装 MySQL: ``` sudo yum install mysql-server ``` 3. 安装 PHP:可以使用以下命令在 CentOS 系统上安装 PHP: ``` sudo yum install php php-mysql ``` 4. 配置 Apache:可以使用 Apache 的配置文件来配置服务器。在 CentOS 系统上,配置文件位于 /etc/httpd/conf/httpd.conf。可以编辑此文件来添加虚拟主机、配置目录和文件权限等。 5. 启动服务:在安装和配置 Apache、MySQL 和 PHP 后,可以使用以下命令启动 Apache 和 MySQL 服务: ``` sudo systemctl start httpd sudo systemctl start mysqld ``` 现在,Web 服务器已经搭建好了。如果您想从外部访问服务器,还需要进行以下步骤: 1. 配置防火墙:在服务器上打开防火墙端口,以便外部网络可以访问您的 Web 服务器。例如,在 CentOS 系统上,可以使用以下命令允许 HTTP 流量: ``` sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload ``` 2. 配置路由器:如果您使用的是家庭网络,可能需要在路由器上配置端口转发,以便从外部网络访问您的 Web 服务器。具体步骤因路由器型号而异,可以参考路由器的用户手册。 完成上述步骤后,您应该可以从外部网络访问您的 Web 服务器了。可以通过在 Web 浏览器中输入服务器的公共 IP 地址来测试访问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值