Gh + Jekyll + LAMP for authentication? - php

I've spent the entire morning scouring the internet trying to find a solution to this and I haven't found one yet so now I'm here. I have a LAMP server on digital ocean and I want to use it strictly as a database server. I have a Jekyll site on Github that I've got up and running, but I want to know if there is a way to send users over to my LAMP server for authentication, but use my Jekyll site for the rest of the website. Would it be possible to redirect the page to the server and then have the root directory of the virtual host in the url location? I want to implement this all on the same domain, but I want to do it this way to make it fast and efficient.
Would I have to use different two nameservers from different domains and would this cause any problems?
I know you can do a Jekyll-Angular-Firebase stack, but I want something that I can maintain on my own and don't have to pay $50 a month for.
Would it be possible to talk to the database in the form itself so that everything else is static and doesn't have to be processed by the lamp server?
Any help would be greatly appreciated. Thanks you.

Just deploy/upload your static site (the '_site' folder in Jekyll) to your LAMP stack and add some php files for authentication.

Related

PHP and node.js on the same server

I am using PHP for the backend of my website and I am introducing a node.js chat. I have everything figured out as far as authentication between the two, and my only problem now is switching between port numbers. How is this handled? Ideally I'd like to hide the port number and I've tried virtual hosts for this, but no matter how I configure the virutal host the server does not load and appears to be down. I am using cloudflare if this matter. But hiding the port isn't required. I just want to smoothly link to the chat app on port 2053 from the PHP app on port 443, and have the chat app link back to the PHP site. PHP uses apache. I can't find any easy way to do this. Been at this problem for days.
After much much research, trial and error I've figured out a few things.
My site consists of mainly PHP, I want to use node.js on a separate page as a chat app. I thought this would be easy, but I was mistaken. It's a lot of pain to get both node.js and PHP to work together flawlessly, and if I knew back then what I know now I might have went a different route. But I have things working for the most part and I am happy.
Some useful info:
If you want to link back to 80 or 443 from your node page, use the full URL with http/s.
If you want to use a virtual host it's only possible on Apache 2.4+ because socket.io can't communicate through it without some apaache mods that allow websocket proxing. It's also possible with NGINX from what I hear but I am less familiar with it.
So in the end I am just keeping the port number and allowing hyper links between the two. This is a temporary solution until I upgrade to either Apache 2.4 or NGINX.

Can't browse the subdomain after visiting a couple of pages of the website made with laravel

I developed this website using Laravel 5.5 for my research group and uploaded it to my university web host. The website's address is in the format of xxxx.cse.yyyy.edu .
When I browse some pages of this website it gets inaccessible and I can't even access the cse.yyyy.edu subdomain anymore for a while (usually after 10-12 hours). I can ping the IP address of the CSE subdomain but can't ping the domain address (possibly a DNS issue?). Although I am not sure, I think restarting my local router makes the website accessible again.
The only thing out of the ordinary about the website is the insecure login page that is not using https at the moment. Other than that, everything is just straightforward laravel code adopted from the original laravel documentations.
I'd be happy to provide more information but I don't really know what kind of info I should be providing here.
What do you think might be causing this problem? Thank you in advance!
So, I figured what was causing the problem. I asked the system administrator to look into the logs of the web host. Turns out that web hosts can have a blocking mechanism in case too many 404 errors are generated. Turning off that mechanism solved my issue. Note that this wasn't something I could fix on my own and might be the same in your case if you don't have full access to your web server settings.

REST API advice for beginner

I'm pretty new in this part of programming so any help would be appreciated.
I've made an app and now I want to allow the user to buy via Braintree. I have implemented it with help of some tutorials using PHP SDK, tested on phone using XAMPP and ngrok. It works perfectly (generates token, makes a payment using testing cards) but now I want to move it online. Just simply move that folder from XAMPP instalation folder somewhere online so I (and all other useres) don't need to use ngrok.
Actually, want to replace
final String API_GET_TOKEN = "https:/smthng-random.ngrok.io/braintree/main.php";
final String API_PAY = "http://smthng-random.ngrok.io//braintree/pay.php";
with
final String API_GET_TOKEN = "https:/WHATEVER/main.php";
final String API_GET_PAY = "https:/WHATEVER/pay.php";
so that can give me the same what I've got with xampp and ngrok.
Thanks in advance
btw: PHP is not my better side of programming so it would be great just to move those 2 files (main.php & pay.php) just like they are :) And I've just found that firebase might be option but just exploring for now :)
I think your request is unclear - it's not REST API advice at all, it's about deploying an application to a live environment.
You have successfully installed your web development environment locally (XAMP, nginx) and now it's time to go live.
You basically need a Linux server capable of running, well, apache mysql, php (get where that XAMP comes from?)
This is only an overview, search how to do each of the topics I'll describe:
1. Find a host. (You should go to the shared, vps hostings if you're inexperienced, otherwise, there are way better hosts like linode, digital ocean and AWS, but those can be a little more challenging for beginners.
2. Buy a domain
3. Point the domain's DNS to your host's IP address or NS
4. Now, upload those files you mentioned to the servers public folder. Servers public folders might differ, specially from shared / vps hostings to full-blown Linux instances. If you go the "cloud" way (digital ocean, etc) usually you'll drop the files at /var/www/html
You'll have to set up virtual hosts if you decide to go for the full blown Linux instances
The files should be accessible now. Make sure versions are consistent between your machine and your servers.

What kind of remote server service was I using?

I’m part of a very small company that uses a database hosted on a server (104.131.##.###). However, the server no longer responds and the person who set up and owns the server space has already left the company. This past employee seems disgruntled so they won’t help. It’s complicated, but we decided to open a new server. The only issue is, I don’t know what we were using.
What I do know is I would access and change the database at http://104.131.##.###/phpmyadmin/ (image of login below)
I also had php files stored on the server using Filezilla (in a “var” folder, if that helps) which were accessed via path: http://104.131.96.###/path/to/file.php
I’ve set up a version of the same server using xampp on my own computer, but I can’t keep my computer running constantly.
So my question is, what service were we using / should we use? Where would I start to set up a new server like this? (I still have the php files and can recreate the db)
I've looked into AWS and digitalOcean, but I'm in a bit over my head and can't tell if they're offering what we need.
Any help would be appreciated. Thank you
The server was using phpmyadmin and mysql and Digital Ocean.
So you need at least a LAMP stack. With the info given we can't help you more.

is it possible to create a system that is connected a website with the same database

Good day. I have a thesis project. it is composed of a webpage created on php and a system using vb.net 2008.
As of now , they are both connected to the same database.
I am wondering if it is possible that if i packaged the system and live the website, will still be connected with one database? Thank you in advance.
If I understand you right (and the question could be better worded), you're asking what happens if you deploy the website on a different server than the one you used to develop it. The short answer is that, unless the machine hosting the database is accessible to the web server host machine, that you would also have to redeploy the database.
In other words, wherever you move the PHP-based website and VB.NET system, they would need to be able to access the machine hosting the database server. Otherwise, I see no issue with them both accessing the same database.

Categories