Method One:
Path= $PATH:/etc/apache/bin
This method is valid only for the current session, and each time you log off or take out the system, the setting is invalid
Method Two:
Vi/etc/profile
Write in the appropriate location: path= $PATH:/etc/apache/bin
$PATH is the default system environment variable path
/etc/apache/bin is the path to the environment variable that needs to be added
If/etc/profile is modified, then the source profile or the Execute Point command is executed after the edit finishes. The value of/profile,path will take effect immediately.
Method Three:
VI ~/.bash_profile
Modify the path line to add/etc/apache/bin
This approach is effective for users
To change path, you must re-login to take effect
The principle of this method is to execute the/etc/profile shell script again, note that if the use of sh/etc/profile is not possible, because SH is executed in the child shell process, even if the path changes will not be reflected in the current environment, but the source is in the current Shell process, so we can see the change in path.
Modify environment variable path path under Linux system