cpanel server question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    cpanel server question

    I want to do the following for my cpanel powered linux server and was wondering the locations of the files to edit / add.

    1. Edit the default .htaccess file for newly created accounts
    2. Edit the default page that comes up when a domains nameservers are pointing to the server but that account has not been added from web host manager.
    3. Add/Edit the default .htaccess file for #2

    If this is all in the same directory that is fine.

    Hope someone can help.
  • directfiesta
    Too lazy to set a custom title
    • Oct 2002
    • 30135

    #2
    Originally posted by mkx
    I want to do the following for my cpanel powered linux server and was wondering the locations of the files to edit / add.

    1. Edit the default .htaccess file for newly created accounts
    2. Edit the default page that comes up when a domains nameservers are pointing to the server but that account has not been added from web host manager.
    3. Add/Edit the default .htaccess file for #2

    If this is all in the same directory that is fine.

    Hope someone can help.
    1. .htaccess ... more like the config file, no ?

    .htaccess file for accounts are in the root of the account, and most of the time only there to indicate with file to open first ( html, htm, php, etc..) and to prevent index.

    More details, people could help you more.
    I know that Asspimple is stoopid ... As he says, it is a FACT !

    But I can't figure out how he can breathe or type , at the same time ....

    Comment

    • mkx
      Confirmed User
      • Nov 2003
      • 4001

      #3
      Thanks for the reply, I need to add document reroutes to the htaccess file so that if someone types in www.mydomain.com/asdjflasdjfladsjflasdjf it will redirect to www.mydomain.com which is the reason I need to find the right .htaccess to edit. There is already a default one added for each newly hosted account, i just need to know the directory it is in so I can edit it. This avoids time wasted by adding the same .htaccess file manually to each new account.

      Comment

      • directfiesta
        Too lazy to set a custom title
        • Oct 2002
        • 30135

        #4
        Originally posted by mkx
        Thanks for the reply, I need to add document reroutes to the htaccess file so that if someone types in www.mydomain.com/asdjflasdjfladsjflasdjf it will redirect to www.mydomain.com which is the reason I need to find the right .htaccess to edit. There is already a default one added for each newly hosted account, i just need to know the directory it is in so I can edit it. This avoids time wasted by adding the same .htaccess file manually to each new account.
        an ;htacces file controls the folder it is in and ALL folders below it.

        Now, www.mydomain.com/asdjflasdjfladsjflasdjf , does that really exist?

        If it is the only file that you want to redirect, use a simple java sript . If you have many of different name, then you would need to use the mod-rewrite.

        You would then say to redirect ALL pages to www.mydomain.com , EXCEPT the actual page that you do not want redirected.

        If you only have a few pages, then in mod_rewrite, you would list those pages with the rewrite instructions.

        That .htaccess file would be in the " public_html " or " www" folder. To see it with an ftp program, make sure that preferfences allows to show " hidden files ".


        EDIT; You also want to edit the " main " file so that when you create a new account it is done the same way ... Not sure about that, maybe with wildcards ( * )
        Last edited by directfiesta; 10-16-2005, 06:42 PM.
        I know that Asspimple is stoopid ... As he says, it is a FACT !

        But I can't figure out how he can breathe or type , at the same time ....

        Comment

        • broke
          Confirmed User
          • Aug 2003
          • 4501

          #5
          I think he's talking setting up an .htaccess template that cpanel will use as the default for all new accounts. I also don't think that cpanel uses a template to create the htaccess files.
          Perfect Gonzo

          Comment

          • mkx
            Confirmed User
            • Nov 2003
            • 4001

            #6
            I need to redirect non existant pages, error pages, etc by adding the following to .htaccess:

            ErrorDocument 400 /
            ErrorDocument 401 /
            ErrorDocument 403 /
            ErrorDocument 404 /
            ErrorDocument 500 /


            That is not my concern. My concern is to find the default .htaccess file that gets added to each newly created account. I already know that it moves the default file into public_html or www but I need to edit the actual file that it is copying it from.

            Comment

            • mkx
              Confirmed User
              • Nov 2003
              • 4001

              #7
              Originally posted by broke
              I think he's talking setting up an .htaccess template that cpanel will use as the default for all new accounts. I also don't think that cpanel uses a template to create the htaccess files.
              That is correct. There is already a default file that gets added to each new account, I think this might have been from an xpanel install on the server, I need to find this file and edit it but I do not know where it is located and do not want to duck anything up. I was just curious if anyone knew the location this might be in.

              Also I wanted to find and edit the page not hosted document that appears when you type in a domain name that is reflected to the servers nameservers but not created on the server to be hosted.

              Comment

              • mkx
                Confirmed User
                • Nov 2003
                • 4001

                #8
                Originally posted by mkx

                2. Edit the default page that comes up when a domains nameservers are pointing to the server but that account has not been added from web host manager.
                Found the file Still have not found the .htaccess files though

                Comment

                • directfiesta
                  Too lazy to set a custom title
                  • Oct 2002
                  • 30135

                  #9
                  for the Cpanel file:

                  use chattr +i index.html to prevent any changes


                  otherwise it could get reset to default in the next update.
                  I know that Asspimple is stoopid ... As he says, it is a FACT !

                  But I can't figure out how he can breathe or type , at the same time ....

                  Comment

                  • seattle
                    Registered User
                    • Aug 2005
                    • 175

                    #10
                    login to the shell.
                    ls -la ~/www

                    You must login to the shell (linux command console?) as the user you have hosted the domains that you are messing with and do that command to see the files that are hidden or start with a '.'.
                    Login to your cpanel frontpage and you can do more.
                    Once you have done this, you can 1)"password protected directories"
                    or 2)manually make your own .htaccess files are both on the spash page for cpanel. browse around and get used to it

                    also, you can create your own customer error pages as you described above. Its under your login main screen. Not WHM (webhostmanager).
                    "custom error pages"
                    redirects are another issue. its best to setup your 404 to redirect back probably.
                    if you have any other cpanel issues, I am running a couple cpanel boxes right now.
                    Last edited by seattle; 10-16-2005, 08:19 PM.

                    Comment

                    • mkx
                      Confirmed User
                      • Nov 2003
                      • 4001

                      #11
                      hmm that didn't work. there is already a default .htaccess file but I cannot seem to find it

                      Comment

                      • broke
                        Confirmed User
                        • Aug 2003
                        • 4501

                        #12
                        I think if you create an .htaccess file in /root/cpanel3-skel/public_html that file will be used when a new account is created.
                        Perfect Gonzo

                        Comment

                        • mkx
                          Confirmed User
                          • Nov 2003
                          • 4001

                          #13
                          Originally posted by broke
                          I think if you create an .htaccess file in /root/cpanel3-skel/public_html that file will be used when a new account is created.
                          that was the first thing i tried i think i will contact xpanel, maybe they added the default .htaccess file and ill try to find out where they put it

                          Comment

                          • dubsix
                            Confirmed User
                            • Dec 2004
                            • 363

                            #14
                            the default .htaccess is contained within the skeleton directory in /root

                            editing anything in there will change the default file set or skeleton set deployed to all new sites created.

                            the same applies to reseller accounts, it will be in the skeleton directory under their main reseller account

                            Comment

                            • mkx
                              Confirmed User
                              • Nov 2003
                              • 4001

                              #15
                              2. Edit the default page that comes up when a domains nameservers are pointing to the server but that account has not been added from web host manager.

                              instead of this, if anyone knows how to allow any domain name that has their name servers redirected to the server, to automatically go to the server not configured page instead of saying page not found.

                              Comment

                              • mkx
                                Confirmed User
                                • Nov 2003
                                • 4001

                                #16
                                Originally posted by WireSix-Ryan
                                the default .htaccess is contained within the skeleton directory in /root

                                editing anything in there will change the default file set or skeleton set deployed to all new sites created.

                                the same applies to reseller accounts, it will be in the skeleton directory under their main reseller account
                                it must be getting over written by another .htaccess file as this is the one in /root/cpanel3-skel/public_html:

                                ErrorDocument 400 /
                                ErrorDocument 401 /
                                ErrorDocument 403 /
                                ErrorDocument 404 /
                                ErrorDocument 500 /


                                and this is the one showing up:
                                # -FrontPage-

                                IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

                                <Limit GET POST>
                                order deny,allow
                                deny from all
                                allow from all
                                </Limit>
                                <Limit PUT DELETE>
                                order deny,allow
                                deny from all
                                </Limit>
                                AuthName www.ajdfljadsfj.com
                                AuthUserFile /home/ajdfljad/public_html/_vti_pvt/service.pwd
                                AuthGroupFile /home/ajdfljad/public_html/_vti_pvt/service.grp

                                Comment

                                • VHNet
                                  Confirmed User
                                  • May 2005
                                  • 386

                                  #17
                                  In your /usr/local/apache/htdocs, change the index.html.en
                                  Bringing mainstream marketing to the Adult Industry

                                  ICQ: 221976033

                                  Comment

                                  • VHNet
                                    Confirmed User
                                    • May 2005
                                    • 386

                                    #18
                                    Woops, not the .en, just the index.html. /usr/local/apache/htdocs/index.html
                                    Bringing mainstream marketing to the Adult Industry

                                    ICQ: 221976033

                                    Comment

                                    • mkx
                                      Confirmed User
                                      • Nov 2003
                                      • 4001

                                      #19
                                      Originally posted by VHNet
                                      In your /usr/local/apache/htdocs, change the index.html.en
                                      i already edited that page but a page not found error still shows up for any domain name using the servers nameservers that hasn't been created.

                                      In a nutshell, i want to be able to set up a default parking page for a bunch of domain names with out having to add them individually to the server, if I change the name servers over to the server and a default parking page is already there, that would make things very easy for me. An example would be sedo. When you change a domains name servers over to sedo's, there is automatically a parking page instead of a page not found.

                                      Comment

                                      • mkx
                                        Confirmed User
                                        • Nov 2003
                                        • 4001

                                        #20
                                        Originally posted by VHNet
                                        Woops, not the .en, just the index.html. /usr/local/apache/htdocs/index.html
                                        did that one first, ;)

                                        Comment

                                        Working...