0

I want turn on the mail server(apache jmail) by normal user(not root user),

so i tried the following step for under 1024 ports.

It runs well when root turns it on.

But it shutting down few second later when normal user turn it on, and it isn't remain any log on server.

I don't under stand why it is happened, and i can't find any solution by googling.

cd /usr/local/java/bin
setcap 'cap_net_bind_service=+ep' java
cd /etc/ld.so.conf.d
vi java.conf ---> /usr/local/java/lib/amd64/jli
ldconfig

cd ~userId
chown –R userId:group projectfolder
cd /volumes
chown –R userId:group shared

vi /etc/security/limits.conf --->
userId soft nofile 65535
userId hard nofile 65535

vi .bash_profile --->
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH

source .bash_profile

1
0

At some point, you are going to have to start something as root. You must be root to listen on port 25. Most mail servers run as root, or they start as root and then fork child processes as an unprivileged user.

Most likely the reason it's failing as a non-root user is that it's getting a "permission denied" on port 25.

If you want to run it as a non-root user, change the configuration to listen to a port above 1024... say 9025 (for example). Then have your firewall portmap incoming connections to port 25 to port 9025 on your mail host.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.