Last semester at my university I got in touch with WebDev.
We build our own website, running on a node.js based framework. We had custom routes, controller, helpers and so on. We had to code on server site and frontend of course. Later on we used Angular for our frontend. The server was completely local of course.
Now I have holidays and I will refresh the website from my father as a little project because it looks and is super old.
I know the Server is running with Apache. I got access to ISPCONFIG and to the website via FTP.
With the FTP i found all the HTML/CSS/js/PHP files. Since this is like very old, it’s kinda hard to read and understand because I have learned very “modern” web style, for example, we don’t use PHP.
This is not so important because I want to make the site new from the ground on.
The part that I don’t understand is the deployment of my website to the server. What I mean by that is that I have only FTP access to the website. When I deploy my site (build in angular most likely) via FTP, how does the Server understand what to do with it when I have no access to the server? Do I have to tell the admin to change the configurations? I have no clue about apache and of course, I will learn the basics to understand what I have to do. But still, I don’t understand how to build the website to fit into apache. I only have access to the folder containing the old website. Can I just deploy my Angular build into this folder, tell the admin to change the config so the server deploys my site?
2
Answers
A typical Apache HTTPD configuration serves static files from a directory (much like Node Express with the
static
module configured).So you would build your Angular code, drop the resulting files in the directory using FTP, then they would be exposed over HTTP.
There shouldn’t be any need to make configuration changes.
Have a look at this: https://angular.io/guide/deployment
Basically when you build your Angular Application only one .html file (index.html) and a couple of .js file are created. You can just copy the output of the dist folder, which will be created on the build process, to your server and everything should be fine.
Apache automatically delivers the index.html file when accessing its via http.