GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   cpanel server question (https://gfy.com/showthread.php?t=528823)

mkx 10-16-2005 07:14 PM

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 10-16-2005 07:28 PM

Quote:

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.

mkx 10-16-2005 07:33 PM

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.

directfiesta 10-16-2005 07:39 PM

Quote:

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 ( * )

broke 10-16-2005 07:42 PM

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.

mkx 10-16-2005 07:45 PM

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.

mkx 10-16-2005 07:48 PM

Quote:

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.

mkx 10-16-2005 08:01 PM

Quote:

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

directfiesta 10-16-2005 08:16 PM

for the Cpanel file:

use chattr +i index.html to prevent any changes


otherwise it could get reset to default in the next update.

seattle 10-16-2005 09:17 PM

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.

mkx 10-16-2005 09:54 PM

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

broke 10-16-2005 10:00 PM

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.

mkx 10-16-2005 10:02 PM

Quote:

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

dubsix 10-16-2005 10:03 PM

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

mkx 10-16-2005 10:06 PM

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.

mkx 10-16-2005 10:09 PM

Quote:

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

VHNet 10-16-2005 10:19 PM

In your /usr/local/apache/htdocs, change the index.html.en

VHNet 10-16-2005 10:23 PM

Woops, not the .en, just the index.html. /usr/local/apache/htdocs/index.html

mkx 10-16-2005 10:26 PM

Quote:

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.

mkx 10-16-2005 10:27 PM

Quote:

Originally Posted by VHNet
Woops, not the .en, just the index.html. /usr/local/apache/htdocs/index.html

did that one first, ;)


All times are GMT -7. The time now is 05:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123