`
wuhuizhong
  • 浏览: 684583 次
  • 性别: Icon_minigender_1
  • 来自: 中山
社区版块
存档分类
最新评论

在RHEL上安裝設置常用服務(ftp,smb,ror+nginx)

阅读更多

---------------------------------------------------------------------------
設置ftp服务
查找vsftpd有没有安装
# rpm -qa|grep vsftpd

安装rpm:
# mount /dev/cdrom /mnt
# rpm -ivh /mnt/Server/vsftpd-2.0.1-8.el4.x86_64.rpm

将防火墙和SELinux停用
1.停用防火墙
# iptables -F
# service iptables stop
2.编辑/etc/selinux/config将SELINUX设为disabled,即SELINUX=disabled
3.客戶端瀏覽器連線設置:
IE不使用Proxy:192.168.*.*
FF直接連線:192.168.151.1/200

启动vsftpd服务
# service vsftpd start

所有的启动级别都自动启动vsftpd服务
chkconfig vsftpd on

匿名方式访问该ftp
文件目录:/var/ftp

---------------------------------------------------------------------------
設置SAMBA服務
查看是否安装:
# rpm -qa|grep samba
system-config-samba-1.2.21-1.el4.1.0.1
samba-common-3.0.33-0.17.el4
samba-3.0.33-0.17.el4
samba-client-3.0.33-0.17.el4

共享权限设计实现及用户和目录建立
要求:
gcmsadm     有管理所有空间的权限,并有自已的私有目录。
gcmsusr      有一个自已的私有空间。
share目录     所有用户只读目录(含匿名)。
user目录     user组用户可读写目录
建立相关用户和用户组
#groupadd gcmsadm;groupadd gcmsusr
建立相关用户
#useradd -g gcmsusr -d /var/ftp/gcms_apps -s /sbin/nologin gcmsusr
#useradd -g gcmsadm -G gcmsadm,gcmsusr -d /var/ftp/gcms_apps -s /sbin/nologin gcmsadm
建立相关目录
#mkdir /var/ftp/gcms_apps

目录权限设计
#chmod 755 /var/ftp/gcms_apps;chown gcmsadm.gcmsadm /var/ftp/gcms_apps

添加samba用户,并设置密码
#cp /etc/samba/passdb.tdb /etc/samba/passdb.tdb.bak
#smbpasswd -a gcmsadm
New SMB password:admgcms
Retype new SMB password:admgcms
……
重复上面的操作,把gcmsusr(密碼usrgcms)都添加进去。
查看用户和密码是否添加进去。
#pdbedit -L -w

配置:
# vi /etc/samba/smb.conf

启动服务:
# service smb start

所有的启动级别都自动启动smb服务
chkconfig smb on

------------------------------------------------------------------------------
安装ruby-enterprise
參考: http://www.rubyenterpriseedition.com/documentation.html#_manual_installation_for_experts

root用戶登錄:
# cd /var/tmp
# tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
# chown -R oracle /opt
oracle用戶登錄
$ vi .profile.custom.noninteractive
加入兩行:
export PATH=/opt/ruby-enterprise/bin:$PATH
export PREFIX=/opt/ruby-enterprise

oracle用戶重新登錄手動安裝
$ cd /var/tmp
$ PREFIX=/opt/ruby-enterprise
$ cd ruby-enterprise-1.8.7-2010.02/source
$ patch -p1 -R < ../fast-threading.patch
$ cd ../..
$ cd ruby-enterprise-1.8.7-2010.02/source/distro/google-perftools-*
$ ./configure --prefix=$PREFIX --disable-dependency-tracking
$ make libtcmalloc_minimal.la
$ cd ../..
$ ./configure --prefix=$PREFIX --enable-mbari-api CFLAGS='-g -O2'
$ make PRELIBS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -ltcmalloc_minimal"
$ make install


完成以上手動安裝再執行:
$ ./installer -c --enable-shared
--------------------------------------------
Warning: some libraries could not be installed
The following gems could not be installed, probably because of an Internet
connection error:

 * mysql -- --with-mysql-config='/usr/bin/mysql_config'
 * sqlite3-ruby
 * pg

These gems are not required, i.e. Ruby Enterprise Edition will work fine without them. But most people use Ruby Enterprise Edition in combination with Phusion Passenger and Ruby on Rails, which do require one or more of the aforementioned gems, so you may want to install them later.

To install the aforementioned gems, please use the following commands:
  * /opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem install mysql -- --with-mysql-config='/usr/bin/mysql_config'
  * /opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem install sqlite3-ruby
  * /opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem install pg

Press ENTER to show the next screen.
Updating /opt/ruby-enterprise/bin/thor...
Updating /opt/ruby-enterprise/bin/rails...
Updating /opt/ruby-enterprise/bin/passenger-install-apache2-module...
Updating /opt/ruby-enterprise/bin/passenger-stress-test...
Updating /opt/ruby-enterprise/bin/rake...
Updating /opt/ruby-enterprise/bin/rdoc...
Updating /opt/ruby-enterprise/bin/rake2thor...
Updating /opt/ruby-enterprise/bin/rackup...
Updating /opt/ruby-enterprise/bin/bundle...
Updating /opt/ruby-enterprise/bin/passenger-memory-stats...
Updating /opt/ruby-enterprise/bin/irb...
Updating /opt/ruby-enterprise/bin/passenger-spawn-server...
Updating /opt/ruby-enterprise/bin/passenger-status...
Updating /opt/ruby-enterprise/bin/erubis...
Updating /opt/ruby-enterprise/bin/gem...
Updating /opt/ruby-enterprise/bin/erb...
Updating /opt/ruby-enterprise/bin/testrb...
Updating /opt/ruby-enterprise/bin/passenger-config...
Updating /opt/ruby-enterprise/bin/passenger-make-enterprisey...
Updating /opt/ruby-enterprise/bin/passenger-install-nginx-module...
Updating /opt/ruby-enterprise/bin/tt...
Updating /opt/ruby-enterprise/bin/ri...
chmod -R g+r,o+r,o-w sqlite3-ruby*
--------------------------------------------
Ruby Enterprise Edition is successfully installed!
If want to use Phusion Passenger (http://www.modrails.com) in combination
with Ruby Enterprise Edition, then you must reinstall Phusion Passenger against
Ruby Enterprise Edition, as follows:

  /opt/ruby-enterprise/bin/passenger-install-apache2-module

Make sure you don't forget to paste the Apache configuration directives that
the installer gives you.


If you ever want to uninstall Ruby Enterprise Edition, simply remove this
directory:

  /opt/ruby-enterprise

If you have any questions, feel free to visit our website:

  http://www.rubyenterpriseedition.com

Enjoy Ruby Enterprise Edition, a product of Phusion (www.phusion.nl) :-)

------------------------------------------------------------------------------
配置nginx
$ /opt/ruby-enterprise/bin/passenger-install-nginx-module
Welcome to the Phusion Passenger Nginx module installer, v2.2.15.

This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.

Here's what you can expect from the installation process:

 1. This installer will compile and install Nginx with Passenger support.
 2. You'll learn how to configure Passenger in Nginx.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.
--------------------------------------------

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /opt/ruby-enterprise/bin/rake
 * rack... found
 * OpenSSL development headers... found
 * Zlib development headers... found

--------------------------------------------

Automatically download and install Nginx?

Nginx doesn't support loadable modules such as some other web servers do,
so in order to install Nginx with Passenger support, it must be recompiled.

Do you want this installer to download, compile and install Nginx for you?

 1. Yes: download, compile and install Nginx for me. (recommended)
    The easiest way to get started. A stock Nginx 0.7.67 with Passenger
    support, but with no other additional third party modules, will be
    installed for you to a directory of your choice.

 2. No: I want to customize my Nginx installation. (for advanced users)
    Choose this if you want to compile Nginx with more third party modules
    besides Passenger, or if you need to pass additional options to Nginx's
    'configure' script. This installer will  1) ask you for the location of
    the Nginx source code,  2) run the 'configure' script according to your
    instructions, and  3) run 'make install'.

Whichever you choose, if you already have an existing Nginx configuration file,
then it will be preserved.

Enter your choice (1 or 2) or press Ctrl-C to abort: 1
--------------------------------------------

Where do you want to install Nginx to?

Please specify a prefix directory [/opt/nginx]:
--------------------------------------------

Nginx with Passenger support was successfully installed.

The Nginx configuration file (/opt/nginx/conf/nginx.conf)
must contain the correct configuration options in order for Phusion Passenger
to function correctly.

This installer has already modified the configuration file for you! The
following configuration snippet was inserted:

  http {
      ...
      passenger_root /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.15;
      passenger_ruby /opt/ruby-enterprise/bin/ruby;
      ...
  }

After you start Nginx, you are ready to deploy any number of Ruby on Rails
applications on Nginx.

Press ENTER to continue.
--------------------------------------------

Deploying a Ruby on Rails application: an example

Suppose you have a Ruby on Rails application in /somewhere. Add a server block
to your Nginx configuration file, set its root to /somewhere/public, and set
'passenger_enabled on', like this:

   server {
      listen 80;
      server_name www.yourhost.com;
      root /somewhere/public;   # <--- be sure to point to 'public'!
      passenger_enabled on;
   }

And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:

  /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.15/doc/Users guide Nginx.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.


---------------------------------------------------------------------------
HTTP服務目錄
服務器端創建目錄:
# ln -s /var/ftp/gcms_apps /opt/nginx/html/gcms_apps
# chmod -R 755 /var/ftp/gcms_apps
# cp /opt/nginx/html/index.html nginx/html/gcms_apps/index.html
客戶端瀏覽器連線設置:
IE不使用Proxy:192.168.*.*
FF直接連線:192.168.151.1/200

------------------------------------------------------------------------------
設置 start and stop nginx with init script:
git clone git://github.com/xdite/rails-nginx-passenger-centos.git
mv rails-nginx-passenger-centos/nginx/nginx /etc/init.d/nginx
chown root:root /etc/init.d/nginx
chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
/etc/init.d/nginx status
/etc/init.d/nginx stop
所有的启动级别都自动启动nginx服务
/sbin/chkconfig nginx on

分享到:
评论

相关推荐

    在RHEL上安裝設置ROR(nginx+passenger+ruby+rails+oracle+netzke)

    在RHEL(Red Hat Enterprise Linux)系统上搭建Ruby on Rails(简称RoR)应用程序环境是一项技术性较强的任务,尤其当涉及到与其他服务如Nginx、Phusion Passenger、Ruby、Rails以及Oracle数据库集成时。以下是对这...

    rhel+nginx+portal

    "RHEL+nginx+portal"的组合正是这样一个解决方案,它将Red Hat Enterprise Linux操作系统、Nginx Web服务器和Portal服务融合在一起,为企业提供了稳定、高性能的平台。 **RHEL(Red Hat Enterprise Linux)** RHEL...

    RHEL9 + Nginx + Lua

    RHEL9 + Nginx 1.24 + Lua 资源包

    linux下搭建FastDFS+Nginx服务器

    接下来,我们将详细探讨如何在Linux系统上安装和配置这两个组件。 首先,我们需要了解FastDFS的基本概念。FastDFS是一个轻量级的分布式文件系统,它为互联网应用提供了高可用、高并发的文件存储解决方案。它的主要...

    tomcat+nginx集群

    在构建高性能、高可用性的Web服务时,"tomcat+nginx集群"是一个常见的架构模式。这个模式结合了Tomcat作为应用服务器处理Java EE应用程序,而Nginx则作为反向代理和负载均衡器,确保流量的高效分配和系统的稳定运行...

    lnmp(centos6.2+nginx+mysql+php)环境搭建系统教程--宋正河

    在安装CentOS 6.2时,需确保网络连接正常,以便通过YUM(Yellowdog Updater, Modified)包管理器获取必要的软件包。 1. **Nginx安装与配置**: Nginx是一款高性能的HTTP和反向代理服务器,以其低内存占用和高并发...

    RHEL7-搭建FTP服务.docx

    在RHEL7上搭建FTP服务,主要步骤包括: 1. 检查并安装vsftpd软件包:`yum -y install vsftpd` 2. 启动FTP服务:`systemctl start vsftpd` 3. 查看FTP服务状态和监听端口:`netstat -anlpt | grep vsftpd` 4. 配置...

    linux+nginx+php配置

    在Linux环境下配置Nginx和PHP之前,确保你的系统是最新的,通过运行`sudo apt update && sudo apt upgrade`(对于基于Debian的发行版如Ubuntu)或`sudo yum update`(对于基于RHEL的发行版如CentOS)来更新所有已...

    NginX on RHEL 安装指南

    NginX on RHEL 安装指南 ...遵循这些步骤,您将能够成功地在RHEL系统上安装并运行NginX,为您的网站或应用程序提供高效、可靠的Web服务。请注意,每个环境都有其独特的需求,因此可能需要根据实际情况调整上述步骤。

    RHEL 8 搭建 Nginx Web 服务.doc

    本文档指导您如何在 RHEL 8 环境中搭建 Nginx Web 服务,包括环境准备、停止 httpd 服务、安装 Nginx、启动 Nginx 服务、配置防火墙、配置 SELinux、查看服务器状态、访问 Nginx Web 服务器和查看 Nginx 软件包文件...

    Linux离线安装nginx安装包

    在Linux系统中,离线安装Nginx是一个常见的需求,特别是在没有互联网连接或者网络环境受限的服务器上。本文将详细讲解如何通过离线方式在Linux上安装Nginx,同时也会涉及Nginx依赖的软件如openssl和gcc的安装过程。 ...

    安装FastDFS+nginx V1.0.docx

    在CentOS或RHEL系统上,可以使用`yum`命令安装`gcc`和`gcc-c++`,它们是编译FastDFS所需的基础工具。接着,安装`libevent`,它是FastDFS运行时依赖的库,可以通过`yum -y install libevent`进行安装。 接下来,我们...

    Django+nginx+uwsgi在linux系统上配置文件

    在大多数Linux发行版中,可以使用包管理器如`apt`(Ubuntu/Debian)或`yum`(CentOS/RHEL)来安装Nginx和uWSGI: ```bash # Ubuntu/Debian sudo apt update sudo apt install nginx uwsgi uwsgi-plugin-python3 # ...

    Nginx安装与使用+WebSocket集群实现及断开重连

    **Nginx安装与使用** Nginx是一款高性能的HTTP和反向代理...通过以上步骤,你可以成功地在Nginx上部署WebSocket服务,并实现集群和断线重连功能。确保在实际操作时根据自己的服务器环境和应用需求进行适当的调整。

    快速搭建项目发布环境 Centos 6.3 + resin3.1.12 + nginx1.x

    1. **安装Java运行环境**:在安装Resin之前,确保系统已经安装了Java Development Kit (JDK)。在CentOS上,可以通过执行`yum install java-1.7.0-openjdk-devel`(或更高版本)来安装。 2. **下载并安装Resin**:...

    nginx+ftp图片上传服务器和访问.rar

    以上就是关于如何在Linux上部署Nginx和FTP服务,实现图片上传和跨服务器访问的详细步骤。通过提供的文档和压缩包中的`nginx-1.8.0.tar.gz`,你可以深入学习Nginx的源码安装和自定义配置。此外,"工具类"可能包含一些...

    RHEL8安装oracle19C数据库详细步骤.docx

    本文档详细介绍了在 RHEL8 操作系统上安装 Oracle 19C 数据库的步骤,包括安装前的准备工作、创建 Oracle 用户和组、配置文件和禁用服务等多个方面。 一、安装前的准备工作 在安装 Oracle 数据库之前,需要进行...

    Linux下Nginx+PHP+MySQL配置(图)

    1. **安装Nginx**:在Linux上,通常使用包管理器如`apt`(Ubuntu/Debian)或`yum`(CentOS/RHEL)来安装Nginx。执行相应的命令,例如`sudo apt-get install nginx`或`sudo yum install nginx`。 2. **安装PHP**:...

    linux下安装Nginx所需依赖包

    总结一下,安装Nginx在Linux上的主要步骤包括:准备依赖包(GCC、PCRE、Zlib、OpenSSL)、安装Nginx、启动服务以及配置自动化启动。理解这些步骤可以帮助我们更好地管理和维护Nginx服务器,提高系统的稳定性和安全性...

    RHEL 8.4 安装Oracle 19c RAC+RU 19.13 文档.docx

    文档主要记录Red Hat Enterprise Linux Server release 8.4上安装19c RAC + RU 19.13 步骤

Global site tag (gtag.js) - Google Analytics