LTS Shared application hosting documentation
This guide is to help users that have a project on LTS shared application servers like python1/2, php1/2/3, or webapps2. It is assumed that you already have a project on one of these servers and an account on the server.
You will need the following prerequisites:
- Basic familiarity with Linux command line tools
- Basic familiarity with git source control
- An SSH client
- Fluency in the programming language and framework used by your project (e. g. Python Flask, or PHP Zend/Laminas)
- Optionally a code editor or development environment.
To update your code:
- Clone its git repo down to your local environment
- When you're done working on your code, commit and push your changes to the git remote
- Connect to the application server where your project lives.
- For Python Flask projects, this will be python1.cc.lehigh.edu
- For PHP projects, this will be php1.cc.lehigh.edu
- For some PHP projects that can't be run in a highly-available environment split across multiple servers, this will be webapps2.cc.lehigh.edu
- For all of them, your login credentials are your normal Lehigh username and password
- Change directory to your project's working directory
- This will be /srv/<project_name>
- This entire folder should be a git repository
- Do a "git pull" to pull down your changes
- If it's a Python project on python1/2:
- You only have to do this on python1 and it will appear on python2 as well because /srv is actually a network shared folder
- There will be a .wsgi in the project folder, usually called <project_name>.wsgi, where the value of <project_name> is your project's name
- To reload your application, run the command "touch project_name.wsgi"
- If it's a PHP project on php1/2/3:
- You have to pull the changes on all three servers - repeat the steps above to SSH to php2.cc.lehigh.edu and php3.cc.lehigh.edu, changing to the project folder and running a "git pull" on each
- If it's a PHP project on webapps2, then you're done
- On all the servers, the web server's error logs are in the file /var/log/apache2/error.log
- If your application isn't working correctly, you can look for problems in this file to troubleshoot
- You can view it with the "less" command or use "tail -f" to watch it live while you try something in your application
- If it's a Python project on python1/2:
Alternatively, if you'd rather edit your code in-place on the server, you can setup an editor like Visual Studio Code. This allows you to open files for editing with a friendly graphical interface through an SSH connection. You can also use a terminal-based editor like emacs or vim in your SSH session if you are comfortable using those tools. You will still want to commit and push your changes to a git remote though so it can be pulled elsewhere and for collaboration.
Helpful resources:
- Basic Linux command line tutorial
- LinkedIn Learning git tutorial - all Lehigh users have access. Use your Lehigh email address as your username and you'll be sent to the Lehigh single sign-on page to login.
- Remote code editing using VS Code
- Python Flask tutorial
- SSH Command
- SCP Command
- SSH Keys
- Community supported python channel - #lts-python in lehigh-home.slack.com
For immediate help, contact the LTS Help Desk (Hours)
EWFM Library | Call: 610-758-4357 (8-HELP) | Text: 610-616-5910 | Chat | helpdesk@lehigh.edu
Submit a help request (login required)