I am trying to setup up my enviroment variable in my Ubuntu machine. Now i did some research and tryed the method on this question Set environment variable in UbuntuSimilar question but the thing is I already wrote up the etc/enviroment the etc/profile and the etc/bash.bashrc file to include my variables:JAVA_HOME=/home/glv/information/jdk1.6.0_25/export JAVA_HOMEBASEDIR=/home/glv/apache-tomcat-6.0.29/  export BASEDIRHowever the problem is when i run the startup.sh on apache it still says that the BASEDIR enviroment variable is not setup right and for all I know the JAVA_HOME may not be correct as well. I am using the latest Ubuntu not sure if that a problem or not or if i have to go another way around it. Any help would be appreciated. 
Setting up enviroment variables in Ubuntu
ubuntu;environment variables
Apache is controlled in Ubuntu by using the Apache init script, at /etc/init.d/apache2. This script is run when you start and stop Apache with commands like:-> sudo service apache2 [start|stop|restart|graceful|etc...]If you look in this init script, you'll see that the environment is set and modified here, by first reading environment variables from the file /etc/apache2/envvars. This separate environment is important because the Apache's server process is a seteuid executable, which means that can run with an effective User ID. On my Ubuntu machine, the Apache processes are run with a user name of 'www-data', even though the root user starts the process. As this is a system account, it has no default shell or bash environment, and uses none of those files that set your user environment.So what I think you want to do is put those environment variables in /etc/apache2/envvars.Update:Apache on Ubuntu has a number of .conf files (in /etc/apache2/ and subdirs) that can also be used to modify the running Apache environment. The configuration files are parsed sequentially, and are all included by the master config file: /etc/apache2/apache2.conf.In these conf files, you can use SetEnv to modify the environment. Then you will know for sure that the environment is as you want. For example, you can add this to /etc/apache2/httpd.conf:- SetEnv JAVA_HOME /home/glv/information/jdk1.6.0_25/