From beb62373ad8330e33840ae14d5eb24441d97b543 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 16 Apr 2026 14:52:16 +0200 Subject: feat: import 36 articles with assets and create supporting shortcodes - Migrate all English articles from old site to content/en/articles/ - Organize article assets in static/uppies/year/month/ structure - Create Italian article stubs with draft=true status - Add 7 new shortcodes: strike, em, dropcap, figure, highlight, img, youtube, gal-img - Update article image paths to reference /uppies/ locations - All 36 articles now build successfully without errors Co-Authored-By: Claude Haiku 4.5 --- .../articles/git-setup-own-server-part2/index.md | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 content/en/articles/git-setup-own-server-part2/index.md (limited to 'content/en/articles/git-setup-own-server-part2') diff --git a/content/en/articles/git-setup-own-server-part2/index.md b/content/en/articles/git-setup-own-server-part2/index.md new file mode 100644 index 0000000..c5b7f49 --- /dev/null +++ b/content/en/articles/git-setup-own-server-part2/index.md @@ -0,0 +1,44 @@ ++++ +title = "Git – how to setup your own server pt 2" +author = "Danilo M." +type = "life" +date = "2018-12-17T07:39:08+00:00" +excerpt = "followup on my previous article regarding GIT and how to automatically deploy python flask scripts to serve a web app with apache." +draft = true +image = "/uppies/2018/12/gitout.jpg" +categories = ["blogging", "code", "diy", "linux"] +tags = ["automation", "do it yourself", "flask", "git", "howto", "python", "ssh"] ++++ +This is a followup on [my previous article about how to setup your server][1] to handle a GIT repository and deploy to a web server like apache. + +Since I started experimenting with python and web publishing with it I wanted a way to push all the changes to my codebase directly to a web server, in a similar way as to what I already do with php and apache.
+ +
+

+ I want to do it myself, the way I like it.. +

+ + danix +
+ +Serving python scripts is slightly different than serving html or php, here’s a scheme that shows what happens when using python (flask in this example) to serve some web content. + + +
+
a simple scheme of how python scripts are served on the web.
+
+ +As you can see the web server is acting as a reverse proxy to the [WSGI][2] server Gunicorn, Apache receives a request from a client, forwards the request to Gunicorn which in turn asks the python web service, in our case our flask web app. Other than as a reverse proxy, apache is used also to serve static content which is not originated in python, like images, css or js scripts. + +In order to deploy a python web app I had to install the mod_wsgi extension for apache, then I decided to use a folder in my system to install the virtual environment for python to run my web app and point to that directory in my vhost configuration file inside apache. After that I created a directory where to store all files for my web app and instructed apache to serve them using the virtualenv I created earlier. This is more or less what I did: + +
# create the virtual environment for python inside
# the folder /usr/local/virtualenvs/my-app:
virtualenv /usr/local/virtualenvs/my-app

# now create the directory inside the apache root
# to store our web app
mkdir /var/www/htdocs/my-app
+ +Now if we put all the py files for our flask web app we can run it inside apache, this is the configuration for the vhost I used: + +
<VirtualHost *:80>
ServerName my-app.mysite.ext
ErrorLog "/var/log/httpd/my-app.error_log"
CustomLog "/var/log/httpd/my-app.access_log" common
WSGIDaemonProcess my-app user=apache group=apache threads=5 python-home=/usr/local/virtualenvs/my-app
WSGIScriptAlias / /var/www/htdocs/my-app/my-app.wsgi
WSGIProcessGroup my-app
Alias "/static/" "/var/www/htdocs/my-app/static/"
<Directory "/var/www/htdocs/my-app/static/">
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/htdocs/my-app/">
Require all granted
</Directory>
</VirtualHost>

+ +With this setting I can now reach my web app and test it after restarting the web server. + + [1]: https://danix.xyz/2018/07/git-setup-own-server/ + [2]: https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface \ No newline at end of file -- cgit v1.2.3