Trying out WHM/cPanel - cpanel

I have a live site running on cPanel. I would like to write some WHM plugins to extend WHM functionality. But the problem I am facing is I don't seem to find a way to get cPanel as a developer version - which I can run on a development environment, test it and then install it to production.
Any idea anyone?

There isn't a developer cPanel available, you could try having a test server/environment with cPanel installed, making the plugin etc and just testing live on that.
you could always open a support ticket with cPanel and see what the have to offer, they might have something which would work for you, but just isn't publicly displayed as such.

Related

How to enable sqlite in Apache php

I have a php sqlite app I cannot make work locally offline .
I downloaded from https://www.sanskrit-lexicon.uni-koeln.de/
I installed MySQL myphpadmin apache2 and sqlite
I am not able to get the DB stuff to run because the app uses sqlite files.
I am not familiar with these tools and I want to run these locally as a user and then tell my friend who is less skilled to do the same. It is really for him. I have php MySQL myphpadmin and Apache running fine. I just need to have the DB work now.
How to do this?
I would prefer not to use xammp be because it is not standard repo stuff but if it really simplifies things you can include that.
We want to make it work offline (Ubuntu) because this monastery wants to be offline as much as possible. (It is a Sanskrit app)

I have problem in back office of prestashop 1.7.5.1

I install prestashop 1.7.5.1 (the final version) in my local server (in wamp server - Apache 2.4.37 - PHP 7.2.14 - MySQL 5.7.24). My front office is ok, but all pages in my back office have problems. For example, in the picture below, My computer is not connected to the Internet.
but when I connect my computer to the internet my back office all is ok as shown in the picture below:
as if jquery or css is not loaded properly in my back office (when My computer is not connected to the Internet).I want work offline on my shop.
Please help me, many thanks.
Remember Prestashop use Bootstrap Framework, if you are offline the CDN wont receive the correct communication, you can see the result
You can try to use the Maintenance mode, to work offline.
This comes because of Prestashop backoffice use some external files of css and images.
To work offline you installed it in your website admin directory.
You can find those external link in your css admin file your_directory/admin_folder/themes/default/css/admin-theme.css

Apache Crash Dialog

I'm running XAMPP on my windows machine and experiencing a problem with Apache crashing a couple times a day. When it does, a dialog pops up and I have to manually tell windows to end the program. After I do that, XAMPP automatically starts it back up in a couple of seconds with no issues. When it crashes while I'm not home though, the server is down until I get back. So I have two questions:
Are periodic crashes something that should be expected, or is this indicative of another issue I should be trying to pinpoint?
If this is something I should just learn to deal with, is there a way to automatically restart httpd.exe when these issues occur, so I don't experience down time when I'm away from home?
You'd look into log files, especially the Apache access and error logs, to see what happened, when you are not at home. I've met some similar situation: I have a problematic PHP script hosted on my server, when someone visits the page, it leads to an Apache crash.
I'd suggest you do the investigation as follows:
Search the timestamp of recent Apache restart.
Check the Apache access log to see whether there are some scripts have been accessed.
Manually access these scripts in your browser (to see if Apache will crash again)
You'd better check the PHP error log as well.
If there is really nothing suspicious, you can try WAMP bundle alternatively, which is also a very popular PHP development environment and it is stable.
Although there aren't many cases in which one should "expect" periodic crashes, in this case you are better of reconsidering your setup. From the frontpage of the XAMPP site:
XAMPP is the most popular PHP development environment
Sure, you can use it as "production" server, but XAMPP isn't build for hosting websites, it is intended as development server, so you don't have to manually setup Apache, PHP and MySQL on you dev machine. If you actually want to run your website for the public, setup Apache/IIS, MySQL and PHP manually, those products on there own are made for running in production. Or you can consider getting some cheap shared hosting somewhere, so you don't need to setup anything.

What is the Bugzilla REST API URL?

I have a Mozilla Bugzilla installed in a server in my office, I want to access the REST API https://wiki.mozilla.org/Bugzilla:REST_API so that I can query Bugzilla bugs from a little project management tool I have made. The problem is I cannot for the life of me work out what the API url should be.
Say I have bugzilla installed on http://bugzilla.mydomain.com/ and I want to query for bug 35 information, I thought the url should look something like this. http://bugzilla.mydomain.com/latest/bug/35
Can explain to me what the URL should look like?
Do I need to tell the admin to config bugzilla differently so I can access the API?
Any help/hints will be greatly appreciated.
Using Bugzilla Version 4.0.1
The "latest" is just part of the way the REST_API team is choosing to deploy the various versions.
You have to install the REST_API at it's own endpoint e.g. http://bugzilla-api.mydomain.com/ and configure it to use your Bugzilla. See the INSTALL file that comes with REST_API.

Developing and Testing a Facebook application

Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.
With a Facebook application things are a bit tricky. As you can't view a Facebook application through a normal web browser (it has to go through the Facebook servers) you can't easily give each developer their own version of the website to work with and test.
I have not come across anything about the best way to develop and test a Facebook application while continuing to have a stable live website that users can use. My question is this, what is the best practice for organising the development and testing of a Facebook application?
Try updating your hosts file (for windows users # c:\windows\System32\Drivers\etc\hosts) with an entry that will route all requests from your live domain back to your machine.
So 127.0.0.1 mywebappthatusesfacebook.com.
Then make sure that your app is running at the root of your webserver. # http://localhost/ Then goto mywebappthatusesfacebook.com in your browser and it should redirect right back to your local machine. Facebook won't know the difference. Hope this helps
The way I and my partner did it was we each made our own private Facebook applications, that pointed to our IP address where we worked on it. Since we worked in the same place, we each picked a different port, and had our router forward that port to our local IP address. It was kinda slow to refresh a page, but it worked very nicely.
You'll have to add both trunk and test versions as different applications and test them using test accounts. You may also use a single application and switch its target URL between cycles.
Testing FB apps is still a rather primitive process.
I generally setup a test application that is a complete copy of the production settings inside the FB development environment that uses an SSH tunnel to point to my development server. You can setup as many applications as you need inside FB - I generally have a development application, a staging app and production. Staging and Production are both on "live" servers rather than an SSH tunnel.
In your application you then use whatever language/framework/server tools are at your disposal to switch the FB configuration based on the server. In Rails, the Facebooker gem actually has built in support for different FB configurations.
Once all of that is done, testing is, unfortunately, still a matter of running the app within FB itself. I use Selenium to automate as much of this as possible.
Best way to do this:
Remove 'App Domain' from 'Basic Info'
Set website's 'Site URL' to : "http://localhost/" .
That simple.
(This only apply if you don't have a live system running in parallel to the test env. In that case get yourself another key.)
We have it setup much like Toby. A series of config files for each developer, that has the Facebook APP Id info (a different app for each developer), separate pages where the app is hosted, and git ignores the config files. We're LAMP with Code Igniter, and it's similar to Rails in that we can set the environment in 1 file, which points to the config with the Facebook constants.
Branching out into Selenium, using unit tests for model-testing.
For local testing we simply use a different app than for the server. In our case the Canvas-URL is set to localhost.local:8000.
You only have to make sure that when you use facebook connect that you type in localhost.local into the address field of the browser and not just localhost.
For testing a canvas or tab app it is faster if you use the 'open iframe in new tab' command of Firefox. This way the session and cookies from Facebook are preserved.
Another solution is NGROK
https://ngrok.com/
It opens a public tunnel to your local app
Example on my rails application by simply typing
./ngrok 3000
I get
http://630066fe.ngrok.com -> 127.0.0.1:3000