An flexible HTTP web server!
Explore the docs »
serveX is a HTTP web server like nginx , meticulously crafted in C++17 by @joseph-el , @tnaceur and @ELkhalil
serveX designed to provide a robust and versatile platform for handling web applications. The server is meticulously crafted to support a wide range of features, making it suitable for various web development scenarios
-
HTTP Methods Support: serveX supports all
HTTP methods, providing a versatile platform for handling various types of requests. -
CGI Interpreter: Execute Common Gateway Interface
(CGI)scripts seamlessly, allowing dynamic content generation on the server. -
Multiple CGI Scripts: serveX can handle
multiple CGIscripts simultaneously, enabling complex web applications and functionalities. -
Cookies and Session Management: Easily manage user
sessionsand store information using cookies, enhancing the interactivity and personalization of web applications. -
Error Logging: The server includes a high-level error
loggerthat detects errors in configuration files, requests, and responses, providing valuable insights for debugging and maintenance.
We includes a optionner tool that allows you to fine-tune the server's behavior. Use the following command-line options to configure serveX according to your requirements:
serveX # run the server with the default config file: cfg/sx_config
serveX -h # Display help
serveX -v # Display the server version and exit
serveX -t # Test the server configuration and exit
serveX -T # Test configuration, dump it, and exit
serveX -c custom_config.conf # Set a custom configuration fileThe serveX HTTP web server boasts an expressive and flexible configuration syntax
The server block serves as the encapsulating structure for the server configuration. It contains global server settings.
server {
listen Host:Port;
server_name exampleName;
client_max_body_size <Size>;
}The location block allows you to define configurations specific to different URI paths.
location <pathToLocation> {
root <path>;
allowed_methods <Methods...>;
index <indexes>...;
upload_path <Path>;
cgi_path <pathToCGI>;
auto_index <off/on>;
return <status> <PathToRedirection>;
}server {
listen 3333;
server_name serverX.com;
client_max_body_size 500M;
location / {
allowed_methods GET HEAD PATCH;
root home;
index index.html;
}
location 42home {
root .;
allowed_methods GET HEAD;
return 301 https://42.fr/en/homepage/;
}
location template {
root .;
index index.html;
allowed_methods GET;
}
location youtube.com {
allowed_methods GET;
root .;
return 301 https://www.youtube.com/channel/UCa8CyDeTWLzoP4hvdQ5_l6w;
}
location upload {
root ./;
index index.html;
allowed_methods GET POST PUT PATCH;
upload_path /goinfre/yoel-idr;
}
}git clone https://github.com/joseph-el/serveX.git- setup the a config file
make ; ./serveX -c path_of_config.cfgSpecial thanks to @tnaceur and @ELkhalil for their valuable contributions to the serveX project.