VDS Sphera Knowledge Base

Main / Browse Categories / Unix / Linux / How can I set environmental variables when my VDS is restarted?

Print article Print Article    Email article Email Article

How can I set environmental variables when my VDS is restarted?
 

NOTE: DO NOT follow this procedure if your account was created AFTER Dec 2006

Create a .profile file on the root(/) of your VDS.

Here is some example content:

export JAVA_HOME=/usr/java/j2sdk1.4.1_03
export PATH=$PATH:$JAVA_HOME/bin

alias ll='ls -la --color'
alias ls='ls --color'
alias path='echo -e ${PATH//:/\\n}'
alias postgres='/usr/local/pgsql/bin/postgres'
Next, edit the /etc/rc.d/rc file.

Change this:

# Unauthorized distribution strictly prohibited.
LANG="C"
export LANG
To this:
# Unauthorized distribution strictly prohibited.
source /.profile
LANG="C"
export LANG
Login to your control panel and restart your VDS. Here are the directions:
http://help.hardhathosting.com/question.php/86

Now, everytime you restart your VDS, all of your aliases, ENV variables, etc. are set.

User Comments
How can I set environmental variables when my VDS is restarted?  
There are no user comments for this topic.
 

Attachments
No attachments.

Related Articles
 How do I create a symbolic link?
 I need to get "xyz" package installed for our program to work and am having issues compiling it.
 How can I change permissions on my files?
 I noticed "file quota" statistics in my Control Panel. Can you explain what this means as I was not aware there were any limitations on the amount of files that could be placed im my VDS?
 Security Scan Vulnerability False Positives

Why Choose Our Hosting?

  • Unmatched Customer Support!
  • Virtual Private Server technology provides a rich, dedicated-like environment for every account.
  • We are known for our superb quality, performance and flexible hosting environment. We manage the server, software, and network you do the rest.
Continue reading »

Featured Hosting Plan


Learn more about our VPS Extreme

What is Included?

  • PHP 5/MySQL 5
  • Parallels® Plesk Panel 10
  • Unique IP Address
  • Daily VPS Backups (Off Server)
  • SAS Hardware Raid diskspace
  • CentOS 5 x86_64 bit
  • Multi-homed Tier 1 Bandwidth
  • Full Upgrade capabilities
Continue reading »