I have CentOS server with WHM and few cPanel accounts. I connect to it using ssh. All cPanel accounts are stored in /home directory.


I also have Ubuntu 14.04 server on which I store all my development scripts in /var/www/html folder and run it under apache2.

Where should I run my scripts on CentOS server? Should I create new cPanel account for it or should I create /var/www/html folder for apache?

My scripts are usually written in PHP and Shell.

I apologize in advance for being offtopic and asking for recommendation.

  • 1
    Your question is vague... there's no reason to store scripts in a web-accessible location, unless you're specifically designing a local web site. – RVT Jul 22 '16 at 9:06
  • 1
    Also, FWIW, it's generally "dangerous" to mix HTML content and scripts. Ideally, even on a webserver, they should be kept in separate directories. – RVT Jul 22 '16 at 9:07

Apache was already installed with Cpanel on CentOS 7.2. Create folder in /home and set ownership to root:nobody to allow apache to access it. That should do the trick.

| improve this answer | |

On CentOS 7.2 /var/www/html is automatically created when installing Apache httpd and is functionally similar to Ubuntu's directory:

[root@t-wiki ~]# rpm -ql httpd | grep /var/www/html
[root@t-wiki ~]# ls -l /var/www/html
total 0
[root@t-wiki ~]# rpm -q httpd
| improve this answer | |
  • This is strange beacause I am using centos-release-7-2.1511.el7.centos.2.10.x86_64 and there is no /var/www/html. [root@cpanel1 ~]# ls /var/ adm cpanel db games kerberos local log named opt profiles spool yp cache crash empty gopher lib lock mail nis preserve run tmp – Kunok Jul 22 '16 at 8:21
  • No package httpd available. – Kunok Jul 22 '16 at 8:24
  • It's actually in the OS Repo. Verify it's enabled in /etc/yum.repos.d/ – RVT Jul 22 '16 at 9:05

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