Obsolete Releases > SME 8.x Contribs

custom template help needed for hosts file / wordpress

<< < (2/8) > >>

janet:
calisun


--- Quote ---Like in mrjhb3 explanation it says to create file, 30customhosts, where did the 30 come from? What does it represent?
--- End quote ---

You do need to read links to information slowly & carefully. To quote from the Howto link provided:

"You can also create new custom template fragments when an existing one does not exist that is suitable for the job. You need to name this in a correct numerical order, so the changes you want to make will be placed in the correct location in the /etc/xxxx config file."

So by placing a number in front of the alphabetical name eg 30 in this case, you specify the order in which the fragment will be processed, which determines the order in which these settings appear in the actual /etc/hosts.conf file.

In most cases the order is important as some things must happen before or after other things, so you would use a higher or lower number accordingly. In this case the 30 is probably arbitrary just because it is the next sequential number after those already used eg 10 & 20



--- Quote ---What about large files like httpd.conf, I see a part I want to change to create wildcard subdomains,
I have no idea how much of the fragment to include to create the desired results.
Also, how do I know if the rest of the httpd.conf entries will not get overwritten by my custom template creation?
Also, what do I name the template? I know the name can be anything, but what about these numbers in front of the name???
--- End quote ---

Partly already answered above.
The name is not important, but the numerical order is probably quite important so your changes get put into the appropriate order.

Find the existing template fragment that looks like it generates the part of the httpd.conf file you want to change, let's say it is 30xyz, then copy it to templates-custom tree & modify the contents, or even create a 31 xyxmychanges (with only your mods in it)
It is not critical, other than ensuring the changes happen in the right place.

As Charlie says, experiment, that's the beauty of sme server. If you make a custom template change that does not work, then simply delete that custom template fragment, expand the template to get your server back to pristine default condition, and try again. If you are getting lot's of messages on the screen when you log in due to the bad fragment you created, then you may need to open/switch to a second console window (Alt F2) and make your changes or corrections there.
NEVER change the actual templates as these are needed to regenerate a pristine default system in the event that you stuff up a custom template modification.

The whole sme template system safeguards you from the "weakness" of other Linux distros, where making changes directly to conf files can end up putting your system into a very unknown & unstable state, where knowledge or personal memory of the many changes you have made over time, may be lost and result in your system being unrecoverable.

In sme only make your (permanent) changes to the custom templates, so the known good functionality is retained in the actual original templates.

Custom template fragments only overwrite the parts of the conf file that they refer to, as the system reads firstly the templates and then reads any custom templates and where custom templates exist (or fragments only) with the identical numerical number and name, then they will replace the main templates/fragments.
That's why typically you copy an existing fragment (leaving the name the same) and just modify the line or two or few that is required. That modified custom template fragment will replace the same named template fragment, but leave all the rest of the conf file unchanged (from default).

To determine what needs to change in any particular /etc/abc.conf file, you really need to do some general Linux homework about that particular conf file settings and what they do and why they are used.
Of course you can ask here to see if someone has a short specifc answer of what to actually change, but there is no guarantee that someone has done exactly what you are after, so do some home study, ask generally in other Linux forums what changes need to be made to the httpd.conf file, and then "translate" those into sme custom template fragments.

I'm sure if you know what change you want in a conf file, then probably someone can tell you where to put it in the fragment system, or certainly steer you in the right direction (which I think these forums & wiki articles are doing for you).


--- Quote ---I know that it might be very easy for you, but a lot is assumed to be common knowledge in the instructions, and for a non programmer like me, end up with more questions afterwards.

--- End quote ---

Most if not all of what I said above is in the Howto referred to or has been said repeatedly in these forums and in other Howtos (so read & search, search & read), so please read the Template Tutorial Howto and the Developers Manual section again VERY CAREFULLY.
I have indulged you and spelt it out here in plain english for you, but you do need to pay more attention to what has already been published.

calisun:

--- Quote from: mary on August 25, 2012, 02:27:41 AM ---"You can also create new custom template fragments when an existing one does not exist that is suitable for the job. You need to name this in a correct numerical order, so the changes you want to make will be placed in the correct location in the /etc/xxxx config file."
--- End quote ---

I did see that, but I was not sure what it was trying to tell me, but your explanation make it clear now.
Thank you everyone for help and explanation.

calisun:
Strangest thing now.
It seems like server changes only fixed the issue partly.

when I connect to my site:
http://
no images
but when I connect:
https://
I see images

Anybody has any ideas what is going on?

I have updated my howto with what I did:  http://wiki.contribs.org/User_talk:Calisun

CharlieBrady:

--- Quote from: calisun on August 27, 2012, 09:54:10 AM ---It seems like server changes only fixed the issue partly.

--- End quote ---

That doesn't surprise me, since you made the changes without understanding what the problem was. See my earlier advice.

calisun:

--- Quote from: CharlieBrady on August 27, 2012, 02:58:29 PM ---That doesn't surprise me, since you made the changes without understanding what the problem was. See my earlier advice.

--- End quote ---

I agree, I don't know, that is why for almost a year I have been posting questions here and on wordpress forum and searching both forums and googling for any possible hints on how to resolve this. I have tried many different suggested fixes, without success.

-Here people say that it is wordpress issue.
-On wordpress forums people say that since wordpress works fine on all other Linux distributions than it is an SME issue.

So I am stuck in the middle without answers. At this point, unless someone points me in the right direction, I don't know where to go from here.

In order to help other SME/ wordpress users, I have put what I have learned into a step-by-step how-to:  http://wiki.contribs.org/User_talk:Calisun

But I can't figure out what I am missing, I am stuck.
Please Help.

ps. once this is figured out, I will update my step-by-step how-to for everyone to benefit.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version