设为首页 收藏本站
查看: 873|回复: 0

[经验分享] 在RHEL上安裝設置常用服務(ftp,smb,ror+nginx)

[复制链接]

尚未签到

发表于 2016-6-11 01:23:19 | 显示全部楼层 |阅读模式
  ---------------------------------------------------------------------------
設置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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-228742-1-1.html 上篇帖子: java ftp上传图片失贞——ASCII 和BINARY模式区别 下篇帖子: .Net框架集WebClient类向WinCE平台上传文件(FTP方式)延迟15秒释疑
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表