Best way to install web applications (e.g. Jira) on Unixes? - unix

Can you throw some points on how it is a best way, best practice
to install web application on Unixes?
Like:
where to place app and its bases and so for,
how to configure to be secure and easy to backup,
etc
For example I know such suggestion -- to set uniq user for each app.
App in question is Jira on FreeBSD, but more general suggestions are also welcomed.

Here's what I did for my JIRA install on Fedora Linux:
Create a separate user to run JIRA
Install JIRA under the JIRA user's home directory
Made a soft link "/home/jira/jira" pointing to the JIRA installation directory (the directory as installed contains the version number, something like /home/jira/atlassian-jira-enterprise-4.0-standalone)
Created an /etc/init.d script to run JIRA as a service, and added it to chkconfig so that it runs at system startup - see these instructions
Created a MySQL database for JIRA on a separate data volume
Set up scheduled XML backups via the JIRA admin interface
Set up a remote backup script to dump the MySQL database and copy the DB dump and XML backups to a separate backup server
In order to avoid having to open extra firewall ports, set up an Apache virtual host "jira.myhost.com" and used mod_proxy to forward requests to the JIRA URL.
I set everything up on a virtual machine (an Amazon EC2 instance in my case) and cloned the machine image so that I can easily restart a new instance if the current one goes down.

Related

Can RDS (Mysql in my case) endpoint be connected with 2 instances in different availability zones?

What am I trying to achieve?
1.Trying to build a fault-tolerant WordPress website.
2.Tried installing the webserver on one AZ with Muti-AZ RDS deployment.It was quite successful.
Set up is as follows
AZ-1 Public subnet - Launched one ec-2 instance, Installed httpd, PHP, PHP-MySQL, WORDPRESS.
AZ-1 Private subnet - Launched a Multi-AZ RDS instance
Problem Encountered:
When I Wanted to expand to another availability zone for fault tolerance.
Launched another ec-2 instance in different availability zone [AZ-2] and installed httpd, PHP, PHP-MySQL, WORDPRESS
I DID NOT launch an another RDS.I wanted to connect to the RDS in [AZ-1]coz its already a Multi-AZ, So wanted to have the fault tolerance set up only for the Web server. I was able to install WordPress on AZ-2 public subnet, but I was unable to connect to the
RDS[MYSQL]endpoint in AZ-1.
Getting the error message.
"Already installed.You appear to have already installed WordPress. To reinstall please clear your old database tables first".
"Already installed.You appear to have already installed WordPress. To
reinstall please clear your old database tables first".
This means your second web server can successfully connect to the RDS instance. Instead of trying to "install" WordPress, just copy all your WordPress files from the first web server and you'll be fine.

Connecting to cache instance (csession) remotely

Is there a way to connect to cache instance (csession) remotely?
Let's say the intersystems is on a container, and I want to use csession on the remote server from my local machine, is there a way (without direct ssh) to run the cache instance?
I'm looking for an alternative way of these steps:
1- scp the cache script into the box
2- ssh into the box
3- run the csesion on the box
Any comments is really appreciated
You could use telnet (encrypted) But this wouldn't allow you to load scripts local to your machine.
One way would be to have your scripts in a git repository and add the loading of them into your instance as post-receive hook.
You might consider using https://intersystems-ru.github.io/webterminal/.
That is "web-based terminal for InterSystems Caché".

Swisscom CloudFoundry with SSH keys

I try to install Wordpress on the Swisscom CloudFoundry application cloud. To install it I need SSH with private and public key pairs (not cf ssh).
I follow the steps here:
https://github.com/cloudfoundry-samples/cf-ex-wordpress
Is this possible? What are the correct values for:
SSH_HOST: user#my-ssh-server.name
SSH_PATH: /home/sshfs/remote
Is this possible?
It depends on your CF provider. This method of running Wordpress requires that you use a FUSE filesystem (SSHFS) to mount the remote files system over the wp-content directory of your Wordpress install. In recent versions of CF (I can't remember exactly where this changed) you are no longer allowed to use FUSE based file systems.
Before you spend a lot of time on this, you might want to validate that your provider still allows FUSE. You can validate with a simple test.
Push any test app to your provider.
cf ssh into the application container.
Check that the sshfs binary is available.
Try using sshfs to mount a remote filesystem (man page | examples).
If you can successfully mount a remote filesystem via SSH using the steps above then you should still be able to use the method described in that example application.
If you cannot, the next best option is to use a plugin that allows storing your media on a remote system. Most of these are for S3. Search google or the WP plugin repo, they're easy enough to find.
There is a better solution on the horizon called Volume Services. You can read more about this here. I have not seen any public CF providers offering volume services though.
What are the correct values for:
SSH_HOST: user#my-ssh-server.name
This should be the user name and host name of your SSH server. This is a server that exists outside of CF. Examples: my-user#192.0.2.10 or some-user#host.example.com. You should be able to ssh <this-value> and connect without entering a password. This is so that the volume can automatically be mounted without user interaction when your app starts.
SSH_PATH: /home/sshfs/remote
This is the full path on the remote server where you'd like to store the Wordpress files. In other words, this directory will be mounted as the wp-content directory of your app.

Deploying an ASP.NET web site to a remote VPS with Jenkins

I am just starting to get my head wrapped around continuous deployment with Jenkins, but I am running into some roadblocks and I haven't really found very many good, definitive resources on the topic in regards to ASP.NET applications.
I have set up a local build server than successfully pulls down code from a SVN repo, and builds it OK with MSBuild. This works well so far, but now I'd like to automate pushing this compiled code to a development server.
My problem is this - from what I gather based on what I read (which may be an incorrect assumption...) is that the staging server is typically within the same network as the build server, meaning you can share network resources, servers, etc.
In my case, I want to run the Jenkins server on a remote VPS, then deploy to other remote VPSes (so, essentially individual isolated machines communicating with each other).
I have seen alot of terms, but I am very new in my Sys Admin / DevOps type skills.
So, my question is this:
Is it even possible to, using Jenkins on a VPS, to then deploy to any particular server I choose? (I have full access to all of them, so if its a security thing, I can fix that... but they are not within the same network/domain)
What is the method to achieve this? I've seen xcopy, Web Deployment Packages (msdeploy), batch scripts, etc. mentioned, but not really a guidance behind what to use in what situations. Are any of these methods useful to achieve my goal?
Thanks for any help or guidance!
How is your Powershell? ;) You should check out psake.
psake is a build automation tool written in PowerShell. It avoids the
angle-bracket tax associated with executable XML by leveraging the
PowerShell syntax in your build scripts. psake has a syntax inspired
by rake (aka make in Ruby) and bake (aka make in Boo), but is easier
to script because it leverages your existent command-line knowledge.
psake is pronounced sake – as in Japanese rice wine. It does NOT rhyme
with make, bake, or rake.
You can deploy your files to the target server through SSH. Jenkins do support transfers through SSH. All you need to do is setting up a SSH server ex : CopSSH and a user account with admin permissions. and configuring the Jenkins to transfer through SSH.
Create host configurations in the main Jenkins configuration
Add an SSH Server
Add the public key to the remote server (the build server)
Click "Test Configuration"
Save
Configure a job to Publish Over SSH (Post Build Action)
Add Transfer Set.
Refer Publish Over SSH For More details

sync file and database drupal

i have 3 servers and install centos 5.5 ,drupal
now i want all server sync file and database
thank you
If you want to have this fully automatic:
Declare on server as master/source server. Any changes on the client machines are overwritten.
Use crontab to start the synchronization repeatedly on the client machines and to start drupal cron on the master machine.
Install ssh and install key files without pass phrase to get secure, reliable and unatended communication between the servers.
Use the backup and migrate module to get a MySql backup triggered by cron.
Do the file synchronization with rsync and keep an eye on file permissions to make sure files are accessible by the apache user on the destination servers.
Import the result of the backup and migrate backup into the client servers db.
A completely different approach would be to use the views module and create RSS Feeds of your nodes. The other servers could read and view them or update their data.
Again a different case: If you want to setup your 3 servers for load balancing / fail over purposes choose a distributed file system and a mirror setup for your db. This way the systems look like one big logical machine with the advantage that single physical machines can crash without crashing the whole system.

Resources