Koozali.org: home of the SME Server

custom template help needed for hosts file / wordpress

Offline calisun

  • *
  • 601
  • +0/-0
custom template help needed for hosts file / wordpress
« on: August 23, 2012, 08:17:03 PM »
I have been dealing with this issue for a very long time, the issue I had was:

If I follow my instructions: http://wiki.contribs.org/User_talk:Calisun

- Simple wordpress installation works fine.
- Multisite install with single domain, ex: domain_com/subsite, works fine.
- But when I try to run multisite with multiple domains, ex: domain1_com domain2_com etc..etc.. pointing to a single wordpress install, the domains work fine and blogs on each domain show up OK, but I was never able to see any images imbedded inside blogs (images uploaded OK, and they would show up while editing the blog, but it would not show up on blog page itself)

After trying many different solutions found here and other pages around the net, I have finally found a solution.
Inside etc/hosts file one only sees:

127.0.0.1   localhost
192.168.3.1    x.domain1.com x

Following the suggestion on the internet, I changed it to:

127.0.0.1   localhost
192.168.3.1    x.domain1.com x
127.0.0.1   *.domain1.com
127.0.0.1   *.domain2.com
127.0.0.1   *.domain3.com

It works great now.
Since I edited the hots file manually, it will get overwritten next time server gets reconfigured.

Is anybody able to help me with writing a custom template so the change will be permanent?

Thank you
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Re: custom template help needed for hosts file / wordpress
« Reply #1 on: August 24, 2012, 01:38:48 AM »
How about just creating this directory, /etc/e-smith/templates-custom/etc/hosts, then create a file say, 30customhosts, and add your additional entries.  Finish with expand-template /etc/hosts
This works for me and survives udpdates, upgrades, etc.
John
......

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #2 on: August 24, 2012, 01:54:45 AM »
calisun

To learn about creating custom templates, so you do not need to ask questions like this again, please read
http://wiki.contribs.org/Template_Tutorial
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #3 on: August 24, 2012, 07:51:01 AM »
mrjhb3, thank you for explaining it to me, you are a life saver.

mary, I did see the tutorial, I am not a programmer and I ended up with more questions afterwards than when I started.

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

Creating custom template for hosts file seems easier for me since it is almost empty to began with. What about large files like httpd.conf, I see a part I want to change to create wildcard subdomains,

FROM:

<VirtualHost 0.0.0.0:80>

    ServerName domain.com
    ServerAlias ftp.domain.com mail.domain.com proxy.domain.com wpad.domain.com www.domain.com x.domain.com

TO:

<VirtualHost 0.0.0.0:80>

    ServerName domain.com
    ServerAlias *.domain.com

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???
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.

SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: custom template help needed for hosts file / wordpress
« Reply #4 on: August 24, 2012, 07:50:32 PM »
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?

Try it and see. Your best teacher is experience.

I wouldn't be changing anything until I understood the original problem. I'm sure there is a way of fixing your problem without altering /etc/hosts. I would start with examining the HTML which is resulting in the non-displayed images.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #5 on: August 25, 2012, 02:27:41 AM »
calisun

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

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???

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.

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.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #6 on: August 25, 2012, 07:51:16 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."

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.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #7 on: August 27, 2012, 09:54:10 AM »
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
« Last Edit: August 27, 2012, 09:57:08 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: custom template help needed for hosts file / wordpress
« Reply #8 on: August 27, 2012, 02:58:29 PM »
It seems like server changes only fixed the issue partly.

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

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #9 on: August 28, 2012, 02:27:47 AM »
That doesn't surprise me, since you made the changes without understanding what the problem was. See my earlier advice.

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.
« Last Edit: August 28, 2012, 04:53:52 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #10 on: August 28, 2012, 04:33:56 AM »
calisun

Quote
At this point, unless someone points me in the right direction, I don't know where to go from here.

Stop ignoring and skipping over the advice given, especially that by Charlie. Examine the html code to see what it is doing, and go from there
Charlie said:
"I would start with examining the HTML which is resulting in the non-displayed images".

Edit: Years ago in my more novice days, a vaguely similar sort of issue was experienced with other web app(s) where some content would display & some would not. IIRC it ended up being wrong permission & ownership on files, in conjunction with using https to access the site, so maybe you have a similar issue and may have copied or loaded content onto the site that is not truly accessible via http or https due to rights. Whether that is your issue or not is something to be determined, and looking at the code will steer you in the right direction.
« Last Edit: August 28, 2012, 04:47:11 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #11 on: August 28, 2012, 05:14:23 AM »
calisun

Stop ignoring and skipping over the advice given, especially that by Charlie. Examine the html code to see what it is doing, and go from there
Charlie said:
"I would start with examining the HTML which is resulting in the non-displayed images".

I did have people from wordpress forum look a my site, and they determined that it is a server configuration issue. You can see the conversation here:
http://wordpress.org/support/topic/images-in-dappped-domains?replies=29

Years ago in my more novice days, a vaguely similar sort of issue was experienced with other web app(s) where some content would display & some would not. IIRC it ended up being wrong permission & ownership on files
I did try changing permissions, to test I even changed all the files and folders to  777, without success.  I did not try changing the ownership, I will see if that helps.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #12 on: August 28, 2012, 05:30:15 AM »
calisun

Well you are accepting that the wordpress people's answer is absolute, and it seems you are not wanting to look at the code as Charlie has suggested.

Actually ownership is more likely the issue I had long ago ie making the files truly web accessible, including files you upload, although there was some issue with https access that I can not recall at present.

Just another thought, there may be issues with permissions and ownership of folders that you upload files to, but we could go on and on guessing & suggesting. Finding out why by looking at the code is a way to work it all out.

While I'm sure I have read your earlier posts & the wiki user page I don't specifically remember what was said or done.
Have you been able to duplicate the whole install & setup process on another server and find that you still have the same issues ?

Has anyone else independent of you been able to duplicate the whole setup & issue on their server ?
« Last Edit: August 28, 2012, 05:33:53 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #13 on: August 28, 2012, 05:49:07 AM »
calisun

I'm just trying to help and suggesting anything.

This from your discussion page:
 Download latest version from www.wordpress.org to your computer and unzip it. Upload unzipped wordpress to desired ibay/html

Do you unzip on a Windows PC and then copy to the ibay via samba/network sharing ?

I would be more inclined to download a wordpress.tar.gz file and untar that directly on the server after cd'ing to the correct ibay folder, all using the command line interface.
Use an appropriate tar command to untar eg something like
tar xvzf wordpress-2.3.1.tgz
so that inappropriate permsissions or ownership are not introduced by Windows copying etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #14 on: August 28, 2012, 05:56:58 AM »
calisun

In the wordpress forum thread you say this:

"Strangest thing, I did some changes to the server and eventually I got the images to show, but only sometimes. For a while I could not figure out why it showed up only sometimes, but eventually it turns out that:
when I connect to my site:
http://
no images
but when I connect:
https://
I see images"


So are you saying that whenever you access using https the images show up each and every time without fail, and conversely whenever you access using http that the images never show up (for the same given example/situation/domain we are referring to)?

A quickie workaround (pending further resolution of the real issue) is just to create an alias to redirect http to https so that all users will automatically use https.
See http://wiki.contribs.org/Https_redirection
That is similar/same as how it is done for webmail etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #15 on: August 28, 2012, 08:01:14 AM »
Mary, thank you very much for taking time to help me out.

calisun

Well you are accepting that the wordpress people's answer is absolute, and it seems you are not wanting to look at the code as Charlie has suggested.
No, personally I don't know what and where to look at, so I am willing to try anybodies suggestion.

...
Have you been able to duplicate the whole install & setup process on another server and find that you still have the same issues ?
I do have a test server, but I am unable to point multiple domains to it, but I will try to figure out a way to do it.

...
Do you unzip on a Windows PC and then copy to the ibay via samba/network sharing ?
...

Usually I download to my Ubuntu pc, unzip,  then I upload to an iBay using filezilla (sftp) from a remote location.

This just came to me right now, could this be related?: since I use sftp to upload the wordpress program before install and images only show up when viewing site using https:


calisun

So are you saying that whenever you access using https the images show up each and every time without fail, and conversely whenever you access using http that the images never show up (for the same given example/situation/domain we are referring to)?

A quickie workaround (pending further resolution of the real issue) is just to create an alias to redirect http to https so that all users will automatically use https.
See http://wiki.contribs.org/Https_redirection
That is similar/same as how it is done for webmail etc.

Great thought about the workaround, but this could cause an issue since the domain is not the primary domain and users trying to access the page will get a certificate warning.
« Last Edit: August 28, 2012, 08:19:01 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #16 on: August 28, 2012, 08:38:52 AM »
calisun

You do not fully answer all the questions, so it's difficult for me to deduce anything more exactly, please answer all questions one by one, or there is no point in me getting involved if you just want to go off yourself and try and discover what's up.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #17 on: August 28, 2012, 09:12:45 AM »
Sorry, I thought I have answered all questions. It is getting late here and I am sleepy, so I might have missed something. I will get a good night sleep and respond in the morning.

Thank you for all your help.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: custom template help needed for hosts file / wordpress
« Reply #18 on: August 28, 2012, 02:58:56 PM »
So are you saying that whenever you access using https the images show up each and every time without fail, and conversely whenever you access using http that the images never show up (for the same given example/situation/domain we are referring to)?

And if that is the case, what do you see in httpd/access_log and httpd/error_log at that time?

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: custom template help needed for hosts file / wordpress
« Reply #19 on: August 28, 2012, 04:25:24 PM »
Calisun,
Don't mess it up for all the rest of us noobs. I just got mary to be nice to me. Answer all her questions. And questions mary thought she asked. We worked hard to get these guys to help us nicely, don't you come in here causing waves.
 :grin:

I was just following this topic because, I too am working very closely with WordPress, and I just successfully moved my WordPress from /opt/wordpress/ to my /"iBay"/html/
This was difficult with all the MySQL searching that had to be done, but now it's operational, and I can finally try DOMAIN Mapping Plugin, and W3TC cache plugin.

I know you are probably thinking, "If you are going to follow, follow quietly". But I just wanted to make Calisun laugh. We noobs have to look out for each other, until we become professionally annoyed with newcomers not reading all forums posts and documentation.
 :lol:
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: custom template help needed for hosts file / wordpress
« Reply #20 on: August 28, 2012, 07:20:43 PM »
Why can't you just create a new domain under server-manager panel, and point it to the same ibay as your primary domain. Then WordPress would take over and direct to the proper page? And you would have a nice panel listing of all the domains you have applied.
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #21 on: August 31, 2012, 07:01:37 AM »
Sorry for not replying for couple of days, it has been crazy at work and I had to work late nights.

And if that is the case, what do you see in httpd/access_log and httpd/error_log at that time?

in httpd/access_log:
Code: [Select]
employment-office.net 92.234.22.22 - - [30/Aug/2012:21:48:27 -0700] "GET /files/2012/05/Hiring-Manager-Reading-resume_2-270x300.jpg HTTP/1.1" 404 255 "http://employment-office.net/82/hiring-managers-view-of-your-resume-and-cover-letter/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"
Primary-domain.com 92.234.22.22 - - [30/Aug/2012:21:48:37 -0700] "GET /employment-office/wp-content/plugins/digg-digg/css/diggdigg-style.css?ver=5.2.3 HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"
employment-office.net 92.234.22.22 - - [30/Aug/2012:21:48:37 -0700] "GET /wp-includes/js/comment-reply.js?ver=3.4.1 HTTP/1.1" 304 - "https://employment-office.net/82/hiring-managers-view-of-your-resume-and-cover-letter/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"
employment-office.net 92.234.22.22 - - [30/Aug/2012:21:48:36 -0700] "GET /82/hiring-managers-view-of-your-resume-and-cover-letter/ HTTP/1.1" 200 90516 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"

In httpd/error_log:

Code: [Select]
[Thu Aug 30 21:48:27 2012] [error] [client 92.234.22.22] File does not exist: /home/e-smith/files/ibays/my-empire/files/2012, referer: http://employment-office.net/82/hiring-managers-view-of-your-resume-and-cover-letter/
[Thu Aug 30 21:48:27 2012] [error] [client 92.234.22.22] File does not exist: /home/e-smith/files/ibays/my-empire/files/2012, referer: http://employment-office.net/82/hiring-managers-view-of-your-resume-and-cover-letter/
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #22 on: September 05, 2012, 10:37:24 PM »
looking at above,
if I access http://
log says:
File does not exist:

but if I access https://
it shows up.

Correct me if I am wrong, but if it was a permission issue, it would say "access denied" not "file does not exist"

 
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #23 on: September 05, 2012, 11:34:31 PM »
calisun

What is the output of these commands ?
ls -al /home/e-smith/files/ibays/my-empire/html/files/2012

ls -al /home/e-smith/files/ibays/my-empire/files/2012

ls -al /home/e-smith/files/ibays/my-empire/files

ls -al /home/e-smith/files/ibays/my-empire/html

ls -al /home/e-smith/files/ibays/my-empire
« Last Edit: September 06, 2012, 04:32:57 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: custom template help needed for hosts file / wordpress
« Reply #24 on: September 06, 2012, 02:30:57 AM »
Correct me if I am wrong, but if it was a permission issue, it would say "access denied" not "file does not exist"

I believe you are correct. This is not a permissions problem. It's an issue with mapping of URLs to files/directories, and the existence or otherwise of those files/directories. Put your thinking cap on, and keep digging.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #25 on: September 30, 2012, 05:50:53 AM »
I keep my fingers crossed, but I think I have figured this out. It is a combination of wordpress and SME issue.

Here is wordpress issue which I have posted it to wordpress forums:

Quote
The reason that https:// works is because it looks like the wordpress primary domain gets called first and it forwards the request to the subfolder, so it looks something like this:
"GET /employment-office/files/2012/05/.......
and I see corresponding code 200 (OK)

but when I go http://
it looks like it gets sent directly to corresponding domain and domain sends code like this:
"GET /files/2012/05/......
and I see corresponding code 404 (Not Found)

The strange thing is that no matter http or https, the header image always gets called:
"GET /employment-office/files/2012/05/.......
and it always shows up.


-->> The SME issue is that when wordpress was calling for "GET /files/2012/05/......, SME was looking in: /iBay/files
I don't understand why it would drop down a level from /html directory since inside wordpress it is set as the base directory.

Anyway, my workaround that seems to work for now is to rename /files directory, so when SME does not find it (I am assuming) it looks inside /html directory.
« Last Edit: September 30, 2012, 06:04:20 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #26 on: September 30, 2012, 07:03:51 AM »
calisun

Quote
my workaround that seems to work for now is to rename /files directory, so when SME does not find it (I am assuming) it looks inside /html directory.

I assume you mean rename
/home/e-smith/files/ibays/my-empire/files/

That .../files folder will probably be recreated during a major system event eg post-upgrade or ibay changes

If I understand and/or assume what your issue is correctly, then perhaps a better long term solution is to move the contents of
/home/e-smith/files/ibays/my-empire/html/files/
to
/home/e-smith/files/ibays/my-empire/files/

or otherwise change the code to read the correct ..../files/ folder
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: custom template help needed for hosts file / wordpress
« Reply #27 on: September 30, 2012, 10:00:19 PM »
I don't understand why it would drop down a level from /html directory since inside wordpress it is set as the base directory.

That's just the way that i-bays work. They are designed to be that way. This is one of the reasons why I've always there are better ways to deploy web applications than just dropping them in an i-bay. Use a custom template, or better yet, a contrib rpm which provides the correct application specific template.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #28 on: October 02, 2012, 08:40:15 AM »
Hi Mary, good to hear from you

calisun

I assume you mean rename
/home/e-smith/files/ibays/my-empire/files/

yes, that is correct.

That .../files folder will probably be recreated during a major system event eg post-upgrade or ibay changes
I just did system update, and post-upgrade, and the change is still there.

If I understand and/or assume what your issue is correctly, then perhaps a better long term solution is to move the contents of
/home/e-smith/files/ibays/my-empire/html/files/
to
/home/e-smith/files/ibays/my-empire/files/

The issue is that there is no such folder as:
/home/e-smith/files/ibays/my-empire/html/files/

the wordpress folder structure is:
/home/e-smith/files/ibays/my-empire/html/wp-content/blogs.dir/#/files/2012/09/   (# is blog#)

wordpress uses htaccess to rewrite / shorten the URL.

or otherwise change the code to read the correct ..../files/ folder

Personally I have no idea where in code the call is created, so I have posted a question on wordpress forum to see if anybody knows. 
But in the mean time, my trick to rename /files folder seems to work.

 
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: custom template help needed for hosts file / wordpress
« Reply #29 on: November 20, 2012, 01:42:58 AM »
I am now dealing with this, but renaming "'ibay'/files" to "'ibay'/fi" does not solve it for me.
If installed to the /opt directory through the rpm or SMESiteMaker, you cannot successfuly run a multisite installation, there's no way to  point the domain to an /opt/ directory instead of an ibay. So in order to use Wordpress MU as your main CMS, it has to be in an ibay. Any more development on this issue with the url rewrite rule? Anyway to change the rewrite rule to include the right GET for the primary domain?
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #30 on: November 25, 2012, 06:30:53 AM »
My work-around that I have posted earlier does not work, it has to be done in a custom-template to make it work.
It took me a while, but I got it figured out what to change and how to create a custom-template for this issue. I will be updating my wordpress "how to" soon, and I will post a notice here when I am done.

« Last Edit: November 25, 2012, 06:59:38 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #31 on: November 25, 2012, 07:43:22 AM »
newburns

I renamed .../ibays/ibayname/files to /files-orig and then created .../ibays/ibayname/html/files folder, put a simple index file in that folder and it was accessible using the domain name I pointed at that ibay (in teh Domains panel), in the form
domainname.com/files

I moved an older single site version of wordpress from /opt (and upgraded it to the latest) into an ibay & it is accessible using a virtual domain name and works fine.

You seem to have unusual problems
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: custom template help needed for hosts file / wordpress
« Reply #32 on: December 02, 2012, 06:26:45 AM »
I have a multisite version. Also, I have many plugins that have altered my .htaccess file such as W3TC, a cs and js minifier, as well as some others for page speed.
I'm not sure if that's why the workaround doesn't work for me, but I believe it has something to do with the new domain listed under Server-Manager. That's the only variable that's different.
Why else does it work for the main domain, but not the other domains?
Where is the template to look into /"ibay"/files anytime http://domain.tld/files is requested?
And how can the .htaccess rewrite be called before the request is sent to /ibays/files?
Also, it seems that anything in httpd.conf gets called first. Should I transfer my .htaccess to httpd.conf?
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #33 on: December 02, 2012, 09:51:06 AM »
newburns

Quote
Where is the template to look into /"ibay"/files anytime http://domain.tld/files is requested?

If you made a little more effort.

I'm sure you know that templates are in
/etc/e-smith/templates

and all httpd.conf template fragments are in
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/

So then by taking a little look around you find
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent

It appears to have aliases eg for the ibay files folder
Whether it's what you want I'm not sure, so try changing it (in a custom template).

Also take a look at:
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
« Last Edit: December 02, 2012, 10:00:17 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #34 on: December 16, 2012, 08:05:54 AM »
I have updated my step-by-step how-to for installing wordpress in an iBay.
I believe I made it clearer than before and I gave instructions on creating custom templates to fix couple of issues.
see it here:
http://wiki.contribs.org/User_talk:Calisun
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline newburns

  • *
  • 345
  • +0/-0
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: custom template help needed for hosts file / wordpress
« Reply #35 on: December 16, 2012, 08:07:36 AM »
Thank You!!! :-o
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline calisun

  • *
  • 601
  • +0/-0
Re: custom template help needed for hosts file / wordpress
« Reply #36 on: December 16, 2012, 08:29:40 AM »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline raem

  • *
  • 3,972
  • +4/-0
Re: custom template help needed for hosts file / wordpress
« Reply #37 on: April 01, 2013, 11:57:09 AM »
calisun

Quote
I have updated my step-by-step how-to for installing wordpress in an iBay.
http://wiki.contribs.org/User_talk:Calisun

I have copied that pretty much "as is" to a Howto page
http://wiki.contribs.org/Wordpress_Multisite
It is now more easily visible to all sme users.

It could do with a bit of layout & formatting improvement, will look at that later, but is OK for now.
Please update this version in future.
I took the liberty of deleting your talk page to avoid confusion & duplication.
...