The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release and a test version of my website.

Discussion in 'General Discussion' started by Arbu, Jun 26, 2017.

  1. Arbu

    Arbu Registered

    Joined:
    Jun 26, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Website Owner
    I'm fairly new to using cPanel. But I want to have two versions of my website with my hosting company. The first, in a subdomain which I use for testing the code. The second directly under my domain. I'm considering obfuscating the code in the main version, under my domain.

    The subdomain is working. So I've copied all the files in that to sit directly under the domain. This includes an index.php file. But when I navigate to my domain in a browser I get "Index of" and a list of the subdomains. Is there something else I have to do?

    Secondly I'd like to password protect the subdomain. I I've set this up through cPanel but it seems to have no effect. How exactly is it supposed to show up?

    Thanks.
     
  2. Arbu

    Arbu Registered

    Joined:
    Jun 26, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Website Owner
    Well, in File Manager of cPanel I have a folder called public_html. Under that there are four folders entitled "example.com", "resipsa", "server" and "server2". Each contains the same folders and files. example.com is the name of my domain, "resipsa" my product and the other two folders have been set up for me by a third party. Putting "server.example.com" or "server2.example.com" into the browser works but putting "resipsa.example.com" or ww w.example.com doesn't. The former tells me "500 Internal Server Error" and the latter gives me the "Index of" message which I described before. All three subdomains are listed under the subdomains facility of cPanel. So clearly just copying folders and files from a subdomain to another one or to the root folder for the domain doesn't work. I have to do something more. But what? I don't see what further information a screenshot would give you.

    Secondly, as I say, I have applied a password through cPanel to one of the server subdomains. But it doesn't seem to do anything. Where is it supposed to show up? When someone is navigating to the subdomain in a browser? Or when someone with access to my file system through cPanel is seeking to access the files? Just saying "oh, you can apply a password" isn't very helpful because it doesn't explain the effect of that password.
     
    #2 Arbu, Jun 27, 2017
    Last edited by a moderator: Jun 27, 2017
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The public_html directory (or root directory) in File Manager is the same as example.com when opened your browser, example.com being your cPanel account's main domain.

    Do you have a second domain added to your cPanel account as an addon domain? Assuming yes as that would create that example.com directory inside the public_html directory. If you don't, it sounds like your 3rd party help copied your account over incorrectly, if I was to guess.

    You should make sure the sub domains are working correctly first, before bothering to copy over files to them. If the files you've copied over to them is for a site that uses a database, wordpress or a shopping cart for example, those duplicated sites need their own databases.

    That earlier worthless post in this thread has been removed.

    In the Directory Privacy area of your cPanel, you click the folder next to the public_html listing there.
    Next, click the resipsa directory name itself to get into that directory.
    There, you find your options to password protect the directory.
    Create a User and set his password, first, and save.
    Next, click the Go back to go back to the same place a second time.
    This time, tick the "Password protect this directory." option at top of page.
    Enter a name, it can be anything here for the "Enter a name for the protected directory" form.
    Click Save a second time.

    Now visit example.com/resipsa/ in your browser to find a pop up asking you for that username and password you just set for that specific directory.

    To remove the password protection, simply go back to that same location and untick the "Password protect this directory", and save.

    All that said, creating a duplicate site in a sub domain is a bit more work to manage (file paths etc.) than creating a duplicate site in a directory inside your public_html. IMHO.

    public_html/ = example.com
    public_html/resipsa/ = stage site, password protected
     
  4. Arbu

    Arbu Registered

    Joined:
    Jun 26, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Website Owner
    Many thanks. The issue with duplicating my subdomain seems to have been that the htaccess file had to be updated for the new location.

    The passwording now works, thanks. It's a bit odd that you have to set up the user and then go back and name the protected folder, but I've done that and I now see what the idea is.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Happy to help. :)
     
Loading...

Share This Page