简体   繁体   English

Amazon AWS版本控制

[英]Amazon AWS version control

I'm managing a website on Amazon Ec2 instance for a while now. 我现在在Amazon Ec2实例上管理一个网站。 Since I'm the only developer and it was used for sandbox I just had one instance running a LAMP image and I would upload locally developed stuff using FTP to review (sandbox mode). 因为我是唯一的开发人员,并且它是用于沙箱的,所以我只有一个实例运行LAMP映像,我将使用FTP上传本地开发的内容以进行审核(沙箱模式)。

Since I'm gaining audience, I want to take this one step forward to setting up a development environment so I can both manage more developers working on the project, and have version control for backup and easy deployment of newly developed code to the users. 由于已经吸引了越来越多的读者,我想朝着建立开发环境的方向迈出这一步,以便既可以管理更多从事该项目的开发人员,又可以进行版本控制以备份新开发的代码并将其轻松部署到用户。

How do I manage different environments on the same instance? 如何在同一实例上管理不同的环境? I wan't a development environment, and production environment, preferably easily managed. 我不需要开发环境和生产环境,最好是易于管理的环境。 It goes both for the code and the data within an sql database. 它适用于sql数据库中的代码和数据。 How do I let other users gain access without sharing my set of keys? 如何让其他用户访问而不共享我的密钥集?

Was looking into elastic beanstalk but it seems to be effective when multiple instances are used and I'll admit, I didn't understand much about how it works. 我一直在研究弹性beantalk,但是当使用多个实例时,它似乎很有效,我承认,我对它的工作原理并不了解。

I guess I'm asking - what is the correct way to develop web applications on amazon AWS services 我想我想问的是-在亚马逊AWS服务上开发Web应用程序的正确方法是什么

My assumptions here: 我在这里的假设:

  • You are running Apache 您正在运行Apache
  • You have already configured your domain so that both mysite.com and test.mysite.com have A records pointing to the IP address of your EC2 instance. 您已经配置了域,以便mysite.com和test.mysite.com都具有指向您的EC2实例的IP地址的A记录

Your Apache web server is configured to handle the VirtualHost mysite.com, eg in /etc/apache2/sites-available/default, or similar to the documentation on Drupal.com : 您的Apache Web服务器配置为处理VirtualHost mysite.com,例如在/ etc / apache2 / sites-available / default中,或者类似于Drupal.com上的文档

<VirtualHost *:80>
        ServerName drupalsite.com
        DocumentRoot /var/www/mysite-production/
        <Directory /var/www/mysite-production/>
                Options +FollowSymLinks Indexes
                AllowOverride All
                order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Now, you need to create a second VirtualHost that maps to a subdomain only: 现在,您需要创建另一个仅映射到子域的VirtualHost:

<VirtualHost *:80>
        ServerName test.drupalsite.com
        DocumentRoot /var/www/mysite-test/
        <Directory /var/www/mysite-test/>
                Options +FollowSymLinks Indexes
                AllowOverride All
                order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Save this in your Apache configuration file and run /etc/init.d/apache2 reload – now any request to test.mysite.com will point to the other directory. 将其保存在您的Apache配置文件中,然后运行/etc/init.d/apache2 reload-现在对test.mysite.com的任何请求都将指向另一个目录。

Make sure you should configure your TEST site instance to use another database than the production server. 确保将TEST站点实例配置为使用生产服务器以外的其他数据库。 It would also be good to secure the testing installation from access by unauthorized users and search engines. 确保测试安装不受未经授权的用户和搜索引擎的访问也将是一件好事。 An .htpasswd lock or a restriction based on IP addres using the mod_access directives. 使用mod_access指令基于IP地址的.htpasswd锁定或限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM